Runway Planning

No attempts yetTime limit1sMemory limit256 MB

Problem

A runway number comes from the heading in degrees divided by ten and rounded. Prefix a leading zero if needed. Use the smaller of the two opposite numbers, except use 18 when the value would be zero. Reduce any value above 18 into the range 1..18. Given a new runway heading hh, output its number.

Input

  • Line 1: number of test cases (at most 100)
  • Each test: integer heading hh (1h3601 \leq h \leq 360)

Output

For each test case, print the two-digit runway number on its own line.