Consider a billiard table of rectangular size n×mn×m with four pockets. Let's introduce a coordinate system with the origin at the lower left corner (see the picture).

There is one ball at the point (x,y)(x,y) currently. Max comes to the table and strikes the ball. The ball starts moving along a line that is parallel to one of the axes or that makes a 45∘45∘ angle with them. We will assume that:
- the angles between the directions of the ball before and after a collision with a side are equal,
- the ball moves indefinitely long, it only stops when it falls into a pocket,
- the ball can be considered as a point, it falls into a pocket if and only if its coordinates coincide with one of the pockets,
- initially the ball is not in a pocket.
Note that the ball can move along some side, in this case the ball will just fall into the pocket at the end of the side.
Your task is to determine whether the ball will fall into a pocket eventually, and if yes, which of the four pockets it will be.
The only line contains 6