Alice has a rectangular matrix of size 10^18 x 10^18. We assume that the matrix rows are numbered from 1 to 10^18 from top to bottom, and the matrix columns are numbered from 1 to 10^18 from left to right. Then the cell of the field at the intersection of the x-th row and the y-th column has coordinates (x.y).
Once Alice had tortoises in this matrix, but now he gets bored from tortoises because they are very slow and this large matrix is definitely not for them. So he decides to replace it with rabbits. Initially, rabbits stand at cell (1, 1). One of the hallmarks of rabbits is that they are very fast. They are twice faster than tortoises and can get from a cell (x, y) into a cell (2 ∗ x, y) or (x, 2 ∗ y) in a few seconds. Also they can go to (x, y − x) or (x − y, y). But the rabbits can not go out of the bounds of the matrix.
It turns out that rabbits got hungry very quickly (this is due to a very fast digestive system). So Alice buys food for them for the next q days and puts this food to cell (xi , yi) in the i-th day. But he does not know are these cells reachable. And he asks you to help him. For each day determine can Alice's rabbits be happy or not.
Input format:
Output format:
It is obvious that how we can achieve (1; 1), (2; 2). We can achieve (4; 7) by following path:
(1; 1) -> (1; 2) -> (1; 4) -> (1; 8) -> (1; 7) -> (2; 7) -> (4; 7)