#include<iostream>
using namespace std;
int n,a[105],cnt;
int main(){
cin >> n;
for(int i = 1; i <= n + 1; i++){
cin >> a[i];
}
cnt = n;
for(int i = 1; i <= n + 1; i++){
if(a[i] > 0){
if(cnt == n){
if(a[i] == 1) cout << "x^" << cnt;
else cout << a[i] << "x^" << cnt;
} else if(cnt != 1){
if(a[i] == 1) cout << "+x^" << cnt;
else cout << "+" << a[i] << "x^" << cnt;
} else {
cout << "+" << a[i] << endl;
}
cnt--;
} else if(a[i] == 0){
cnt--;
continue;
} else {
if(cnt != 1){
if(a[i] == -1) cout << "-x^" << cnt;
else cout << a[i] << "x^" << cnt;
} else {
cout << a[i] << endl;
}
cnt--;
}
}
return 0;
}