#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <iomanip>
using namespace std;
int A[100000];
int B[100000];
int main()
{
int n,i,h = 0;
cin >> n;
for(i = 1;i <= n + 1;i++)
{
cin >> A[i];
}
if(A[1] != 0)
{
if(A[1] > 0)
{
if(A[1] == 1)
{
cout << "x^" << n;
h = 1;
}
else
{
cout << A[1] << "x^" << n;
h = 1;
}
}
else
{
if(A[1] == -1)
{
cout << "-" << "x^" << n;
h = 1;
}
else
{
cout << A[1] << "x^" << n;
h = 1;
}
}
}
for(i = 2;i <= n;i++)
{
if(A[i] == 0)continue;
else
{
if(n - i + 1 == 0)
{
if(A[i] > 0)
{
if(h == 0)
{
cout << A[i];
h = 1;
}
else
{
cout << "+" << A[i];
}
}
else cout << A[i],h = 1;
}
else
{
if(A[i] > 0)
{
if(n - i + 1 == 1)
{
if(h == 0)
{
if(A[i] == 1)
{
cout << "x";
h = 1;
}
else
{
cout << A[i] << "x";
h = 1;
}
}
else
{
if(A[i] == 1)
{
cout << "+" << "x";
h = 1;
}
else
{
cout << "+" << A[i] << "x";
h = 1;
}
}
}
else
{
if(h == 0)
{
if(A[i] == 1)
{
cout << "x^" << n - i + 1;
h = 1;
}
else
{
cout << A[i] << "x^" << n - i + 1;
h = 1;
}
}
else
{
if(A[i] == 1)
{
cout << "+" << "x^" << n - i + 1;
}
else
{
cout << "+" << A[i] << "x^" << n - i + 1;
}
}
}
}
else
{
if(n - i + 1 == 1)
{
if(A[i] == -1)
{
cout << "-" << "x";
}
else
{
cout << A[i] << "x";
}
}
else
{
if(A[i] == -1)
{
cout << "-" << "x^" << n - i + 1;
}
else
{
cout << A[i] << "x^" << n - i + 1;
}
}
}
}
}
}
if(h == 0)
{
cout << A[n +1];
}
else
{
if(A[n + 1] < 0) cout << A[n + 1];
else cout << "+" << A[n + 1];
}
return 0;
}