Long ago the land of Utopia was split by war into four regions, separated by one vertical line (a north-south longitude) and one horizontal line (an east-west latitude). Their crossing point is the origin $(0, 0)$. A location is described by two numbers: how far east and how far north it lies from the origin, and either number may be negative. The four regions are:

Citizens may not cross a border, so travel is done by a teleporter that starts at the origin $(0, 0)$. The teleporter is driven by code numbers: you are given $2N$ distinct positive code numbers, each of which may be used exactly once. Using a code pair $(\pm u, \pm v)$ at the current point $(x, y)$ moves the teleporter to $(x \pm u,\ y \pm v)$. You choose the order of the $2N$ numbers, split them into $N$ pairs, and give each number a $+$ or $-$ sign; in each pair one number is the $x$-displacement and the other is the $y$-displacement.
You are given a sequence of $N$ region numbers. After the $i$-th teleport the machine must land strictly inside the $i$-th requested region (the signs of $x$ and $y$ must match that region); it may never come to rest on a border, i.e. never on a line $x = 0$ or $y = 0$. Two or more consecutive requests may name the same region.
For example, with code numbers 7 5 6 1 3 2 4 8 and region sequence 4 1 2 1, the code pairs $(+1, -7), (+2, +8), (-6, +3), (+4, +5)$ move the teleporter $(0,0) \to (1,-7) \to (3,1) \to (-3,4) \to (1,9)$, which lie in Utopia $4, 1, 2, 1$ respectively. Among all valid guidings for this input, that one is the lexicographically smallest.
A valid guiding always exists. When more than one exists, you must report the lexicographically smallest one, as defined in the output section.
The first line contains an integer $N$ ($1 \le N \le 10$).
The second line contains the $2N$ distinct code numbers, integers with $1 \le \text{code number} \le 100000$, separated by single spaces.
The third line contains the sequence of $N$ region numbers, each equal to $1$, $2$, $3$, or $4$, separated by single spaces.
Print $N$ lines. The $i$-th line describes the $i$-th code pair as sx sy, where sx is the $x$-displacement and sy is the $y$-displacement. Each displacement is written with a leading sign (+ or -) immediately followed by its magnitude (no space after the sign), and the two displacements are separated by a single space.
A valid guiding always exists. When several valid guidings exist, print the lexicographically smallest one. Guidings are compared by the sequence of signed displacements in order — $dx_1, dy_1, dx_2, dy_2, \dots, dx_N, dy_N$ (at each step the $x$-displacement comes before the $y$-displacement) — where the integers are compared by value, so a more negative displacement is considered smaller.