Question
Aditya's special torch

Aditya has a special torch. The torch has 4 levels numbered 1 to 4 and 2 states (On and Off). Levels 1, 2 and 3 correspond to the On state while level 4 corresponds to the Off state.
The levels of the torch can be changed as:

  • Level 1 changes to level 2.
  • Level 2 changes to level 3.
  • Level 3 changes to level 4.
  • Level 4 changes to level 1.

Given the initial state as K and the number of changes made in the levels as N, find the final state of the torch. If the final state cannot be determined, print Ambiguous instead.

Input
First line will contain T, the number of test cases. Then the test cases follow.
Each test case contains of a single line of input, two integers N, K - the number of changes made in the levels and initial state of the torch. Here, K = 0 denotes Off state while K = 1 denotes On state.

Constraints
1 ≤ T ≤ 105
0 ≤ N ≤ 109
0 ≤ K ≤ 1
Output
For each test case, output in a single line, the final state of the torch, i.e. On or Off. If the final state cannot be determined, print Ambiguous instead.
Example
Input
2
4 0
0 1
Output
Off
On
Explanation
Test case 1: Initially, the torch is in Off state. Since only level 4 corresponds to the Off state, the torch is at level 4 initially. After 4 changes, the final level would be 4. Level 4 corresponds to the Off state. Hence, finally the torch is Off.
Test case 2:  Initially, the torch is in On state. After 0 changes, the torch remains in the On state.

Online