Spiral Area Division

No attempts yetTime limit1sMemory limit64 MB

Problem

An 80 by 80 square is repeatedly split into 3:1 area pieces by alternating vertical and horizontal cuts. The small piece receives labels 1 through 15. For each point (x,y)(x,y) not on a cut line, report its label.

Input

The first line contains nn points (1n1001 \le n \le 100). Each of the next nn lines contains xx and yy with 0x,y800 \le x,y \le 80.

Output

Print the region label for each point on its own line.