Олимпиадный тренинг

Задача 37693. space chess


Задача

Темы:
Space chess is played on an infinite board, so the cells are numbered with a pair of numbers (see the example and the picture for it). The pieces move according to the usual rules. Make a route for the chess knight from the cell (0; 0) to the given cell (x; y).
Recall that in one move the knight moves one cell along one axis and two along the other, that is, for example, from cell (0; 0) it can get into cells (1; 2), (2; 1), (-1; 2), (2; -1), (1; -2), (-2; 1), (-1; -2) and (-2; -1).< br />
As an answer, you need to print any (not necessarily the shortest) route starting at (0; 0) and ending at (x; y), the length of which is no more than 105 moves.

Input data format
The program receives as input two integers x and y written in separate lines - the coordinates of the final cell of the knight's route. Cell (x; y) does not match the origin. |x| <= 105, |y| <= 105.

Output data format
The program should output a sequence of moves, one move on a separate line. The i-th line should contain two numbers xi and yi separated by a space - the coordinates of the cell where the knight will be after the i-th move. The number of moves must not exceed 105. The last move must lead to a given cell
 
Input Output
-2
2
-2 1
0 2
-1 0
-2 2

Drawing example