402911: GYM100942 L Three machines
Description
Three machines read integers from the inserted cards and print new cards with pairs of positive integers. The first machine reads the card (a;b) and outputs a new card (a + 1;b + 1).The second machine reads the card (a;b), and if both numbers are even integers, outputs the card (a / 2;b / 2). When two cards (a;b) and (b;c) are inserted into the third machine, it outputs the card (a;c). All machines return the inserted cards.
There is a single card (a;b). It is necessary to obtain the card (c;d) or find it impossible.
InputThe first line contains integers a and b. The second line contains c and d (1 ≤ a, b, c, d ≤ 2000). The initial and the final cards are different.
OutputIf it is not possible to obtain the required card, output 0. Otherwise print k in the first line — number of times the machines have been used. In the following k lines output usage description in the following format: « <number of the machine> <integers on the first card> [<integers on the second card>] ». If the third machine is used, the second integer on the first card must be equal to the first integer on the second card. k must not exceed 15000.
ExamplesInput2 4Output
1 3
3Input
2 2 4
1 1 2
3 1 2 2 3
4 2Output
1 1
0