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