#cf16exhibitionfinali. [cf16_exhibition_final_i]90 and 270

[cf16_exhibition_final_i]90 and 270

Problem Statement

#nck { width: 30px; height: auto; }

Construct an NN-gon that satisfies the following conditions:

  • The polygon is simple (see notes for the definition).
  • Each edge of the polygon is parallel to one of the coordinate axes.
  • Each coordinate is an integer between 00 and 10910^9, inclusive.
  • The vertices are numbered 11 through NN in counter-clockwise order.
  • The internal angle at the ii-th vertex is exactly aia_i degrees.

In case there are multiple possible answers, you can output any.

Notes

A polygon is called simple if each edge has a positive length, and no two edges have a common point (except for adjacent edges touching at a vertex).

Constraints

  • 3N10003 ≤ N ≤ 1000
  • aia_i is either 9090 or 270270.

Input

The input is given from Standard Input in the following format:

NN a1a_1 : aNa_N

Output

In case the answer exists, print the answer in the following format:

x1x_1 y1y_1 : xNx_N yNy_N

Here (xi,yi)(x_i, y_i) are the coordinates of the ii-th vertex.

In case the answer doesn't exist, print a single -1.


Sample Input 1

8
90
90
270
90
90
90
270
90

Sample Output 1

0 0
2 0
2 1
3 1
3 2
1 2
1 1
0 1

Sample Input 2

3
90
90
90

Sample Output 2

-1