Cutting pizza

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Technical committee members were working late and ordered a pizza. When they were delivered a round, tasty and satisfying pizza, they faced a problem: they wanted to cut this pizza as quickly as possible.

Each technical committee member announced the number α_i\alpha\_i, which describes how much pizza she wants to eat. For convenience, they decided to use the angular measure of the desired piece in degrees: the number α_i\alpha\_i means that this person wants to get exactly one piece of pizza in the form of a sector with an angular measure of α_i\alpha\_i degrees.

They use a special pizza knife to cut pizza. It can make two types of cuts: straight cuts from the center of the pizza to the edge (the knife passes the radius of the circle) and straight cuts from one edge to the other edge through the center (the knife passes the diameter of the circle). After cutting, the obtained sectors can be distributed in any order, one to each eater, and the remaining pieces remain in the box.

What is the minimum number of cuts they need to make, so that each member of the technical committee gets exactly the requested piece of pizza?

입력

The first line contains an integer nn --- the size of the technical committee (1n161 \le n \le 16). The next line contains nn integers α_i\alpha\_i --- angular measures in degrees of the desired pizza sectors (1α_i<3601 \le \alpha\_i < 360).

It is guaranteed that the sum of all α_i\alpha\_i does not exceed 360360.

출력

Output the integer mm in the first line --- the minimum number of cuts they need. Output descriptions of the cuts in the next mm lines.

Each cut is represented by two integers β_i\beta\_i (0β_i<3600 \le \beta\_i < 360) and type_itype\_i --- the rotation angle and the type of the cut. The rotation angle is measured from a fixed axis in a fixed direction (for example, from a north-directed axis, clockwise). The type of the cut type_itype\_i is 00 if the knife passes the radius, and is 11 if the knife passes the diameter.