#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using i128=__int128_t;
using u128=__uint128_t;
using ld=long double;
void solve()
{
int n;
cin >> n;
vector<int>v(n+1,0);
for(int i=n;i>=0;i--) cin >> v[i];
for(int i=n;i>=0;i--)//思路有点乱 胡乱模拟 凑活看吧
{
if(i!=n)
{
if(v[i]>0) cout << '+';
else if(v[i]<0) cout << '-';
}
else
{
if(v[i]<0) cout << '-';
}
if(abs(v[i])!=1&&abs(v[i])!=0&&i!=0&&i!=1)
{
cout << abs(v[i]) << "x^" << i;
}
else if(abs(v[i])==1&&i!=0&&i!=1) cout << "x^" << i;
else if(v[i]!=0&&i==0) cout << abs(v[i]);
else if(abs(v[i])!=1&&v[i]!=0&&i==1) cout << abs(v[i]) << 'x';
else if(abs(v[i])==1&&v[i]!=0&&i==1) cout << 'x';
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int t=1;
//cin >> t;
while(t--)
{
solve();
}
return 0;
}