Anka and Petka were waiting for Chapaev and eating potatoes. Soon they were
full and decided to play the “Chapaev” game using the remaining four
Petka took a 20 × 20 board, put the potatoes on it, and declared
the following rules. No two potatoes could lie on the same square, and a
player could shoot at a potato and knock it off the board with another
potato only if the potatoes were in the same vertical or horizontal
line and there were no other potatoes between them.
Anka suggested to take some potatoes and put them on unoccupied squares of the board so that each potato
could be used to shoot at exactly one another potato. Help Petka do this
by changing the positions of as few potatoes as possible.
The four input lines contain the coordinates xi,
yi of the potatoes.
The coordinates are integers in the range from 1 to 20.
No two potatoes are on the same square.
Output the new coordinates of the potatoes. The potatoes must be described
in the same order as in the input.
If there are several answers, output any of them.
Problem Author: Dmitry Ivankov
Problem Source: NEERC 2010, Eastern subregional contest