#include <cstdio>
#include <cassert>
#include <algorithm>
using namespace std;

const int N = 1050;

struct vt {
    int x, y;
    vt(int _x, int _y) {
        x = _x, y = _y;
    }
    vt() {}
    friend vt operator +(vt a, vt b) {
        return vt(a.x + b.x, a.y + b.y);
    }
    friend vt operator -(vt a, vt b) {
        return vt(a.x - b.x, a.y - b.y);
    }
    friend vt operator ~(vt v) {
        return vt(-v.y, v.x);
    }
    friend int operator *(vt a, vt b) {
        return a.x * b.x + a.y * b.y;
    }
    int l1abs() {
        return abs(x) + abs(y);
    }
    vt norm() {
        int l = l1abs();
        return vt(x / l, y / l);
    }
    friend bool operator ==(vt a, vt b) {
        return a.x == b.x && a.y == b.y;
    }
};

vector<char> S;

vector<vt> P;
int m;

inline void shift(vt dir, vt as) {
    for (int i = 0; i < m; i++) {
        if ((P[i] - as) * dir >= 0)
            P[i] = P[i] + dir;
    }
}

int tp[N];
// 0 - LR
// 1 - RL
int oper[N];

bool in_seg(int a, int b, int c) {
    return a <= b && b <= c;
}

bool inter(vt a, vt b, vt c, vt d) {
    if (a.y == b.y)
        swap(a, c), swap(b, d);
    return in_seg(a.y, c.y, b.y) && in_seg(c.x, a.x, d.x);
}

vector<char> orig_S;

void check() {
    for (int i = 0; i < m; i++) {
        vt a = P[i], b = P[(i + 1) % m], c = P[(i + 2) % m];
        vt u = (b - a).norm();
        vt v = (c - b).norm();
        if (S[i] == 'L')
            assert(~u == v);
        else
            assert(~v == u);
    }
    for (int i = 0; i < m; i += 2) {
        for (int j = 1; j < m; j += 2) {
            if (abs(i - j) <= 1)
                continue;
            if (i == 0 && j == m - 1)
                continue;
            assert(!inter(P[i], P[(i + 1) % m], P[j % m], P[(j + 1) % m]));
        }
    }
}

int main() {
    int n;
    scanf("%d", &n);
    int bal = 0;
    S.resize(n);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        S[i] = "RL"[x == 90];
        bal += (S[i] == 'L') - (S[i] == 'R');
    }
    orig_S = S;
    if (bal != 4) {
        puts("-1");
        return 0;
    }
    m = n;
    int pt = 0;
    while (m > 4) {
        bool found = false;
        for (int i = 0; i < m - 1; i++) {
            if (S[i] != S[i + 1]) {
                tp[pt] = S[i] == 'R';
                oper[pt] = i;
                pt++;
                found = true;
                break;
            }
        }
        assert(found);
        int pos = oper[pt - 1];
        S.erase(S.begin() + pos, S.begin() + pos + 2);
        m -= 2;
    }
    P = { vt(0, 0), vt(1, 0), vt(1, 1), vt(0, 1) };
    check();

    while ((--pt) >= 0) {
        int pos = oper[pt];
        // LR
        vt v = P[(pos + 1) % m] - P[pos % m];
        v = v.norm();
        vt u = (tp[pt] == 0) ? ~v : ~~~v;
        shift(v, P[(pos + 1) % m]);
        assert((P[(pos + 1) % m] - P[pos % m]).l1abs() >= 2);
        shift(u, P[pos % m] + u);
        P[(pos + 1) % m] = P[(pos + 1) % m] + u;
        P.insert(P.begin() + pos % m + 1, P[pos % m] + v);
        P.insert(P.begin() + pos % m + 2, P[pos % m] + v + u);
        S.insert(S.begin() + pos, (tp[pt] == 0 ? 'L' : 'R'));
        S.insert(S.begin() + pos + 1, (tp[pt] == 0 ? 'R' : 'L'));
        if (pos == m) {
            rotate(P.begin(), P.begin() + 2, P.end());
        }
        m += 2;
        //check();
    }
    assert(S == orig_S);
    check();
    rotate(P.begin(), P.begin() + 1, P.end());
    int mnx = 0;
    int mny = 0;
    for (auto p : P)
        mnx = min(mnx, p.x), mny = min(mny, p.y);
    for (auto& p : P)
        p.x -= mnx, p.y -= mny;
    for (auto p : P)
        printf("%d %d\n", p.x, p.y);
}


Measured memory_bytes: 256