#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using PII=pair<ll,ll>;
using PIII=pair<int,pair<int,int>>;
const ld ESP = 1e-10;
const ld PI = acosl(-1);
const int N=1e5+10;
const int M=2e5+10;
// const int mod = 1000000007;
const int mod = 998244353;
//随机化
random_device rd;
mt19937 gen(rd());
uniform_int_distribution<> dis(1, 1000000000);
void solve(){
int n;
cin>>n;
int c[n+1];
for(int i=0;i<=n;i++){
cin>>c[i];
}
int f=0;
for(int i=0;i<=n;i++){
if(c[i]==0)continue;
else{
if(i>=n-1){
if(i==n){
if(f==0){
cout<<c[i];
f=1;
}else{
if(c[i]>0)cout<<"+"<<c[i];
else cout<<c[i];
}
}else{
if(f==0){
if(c[i]==1){
cout<<"x";
}else if(c[i]==-1){
cout<<"-x";
}else{
cout<<c[i]<<"x";
}
f=1;
}else{
if(c[i]==1){
cout<<"+x";
}else if(c[i]==-1){
cout<<"-x";
}else{
if(c[i]>0)cout<<"+"<<c[i]<<"x";
else cout<<c[i]<<"x";
}
}
}
}else{
if(f==0){
if(c[i]==1){
cout<<"x^"<<n-i;
}else if(c[i]==-1){
cout<<"-x^"<<n-i;
}else{
cout<<c[i]<<"x^"<<n-i;
}
f=1;
}else{
if(c[i]==1){
cout<<"+x^"<<n-i;
}else if(c[i]==-1){
cout<<"-x^"<<n-i;
}else{
if(c[i]>0)cout<<"+"<<c[i]<<"x^"<<n-i;
else cout<<c[i]<<"x^"<<n-i;
}
}
}
}
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int _=1;
// cin>>_;
while(_--){
solve();
}
return 0;
}