eolymp
bolt
Try our new interface for solving problems
Problems

Anniversary Cake

Anniversary Cake

Two students, Adam and Anton, are celebrating two-year anniversary of not passing their Math Logic exam. After very careful search in a local supermarket, they bought a rectangular cake with integer dimensions and two candles. Later in the campus Adam put the candles into different integer points of the cake and gave a knife to Anton to cut the cake. The cut should start and end at integer points at the edges of the cake, and it should not touch the candles. Also each piece should have exactly one candle at it. Please, help Anton to find the starting and ending points of the cut. \includegraphics{https://static.e-olymp.com/content/0f/0f85a46b886c7dfd1886d6e7c431b5f2de571391.gif} \InputFile The single line contains six integers: $w, h$ --- cake dimensions; $a_x, a_y$ --- coordinates of the first candle; $b_x, b_y$ --- the coordinates of the second candle $(3 \le w, h \le 10^9, 0 < a_x, b_x < w; 0 < a_y, b_y < h; a_x \ne b_x$ or $a_y \ne b_y)$ \OutputFile Print four integers $s_x, s_y, e_x$ and $e_y$ --- the starting and ending coordinates of the cut. Both starting and ending point of the cut should belong to the sides of the cake. If there are several solutions, output any of them.
Time limit 1 second
Memory limit 128 MiB
Input example #1
7 3 2 2 3 2
Output example #1
2 0 3 3
Source 2016 ACM NEERC, Northern region, October 22, Problem A