Anniversary Cake

Given a rectangle and two interior candles, output the specific cut described by a fixed rule that separates the candles.

Easy2GeometryImplementationMathNo attempts yetTime limit2sMemory limit256 MB

Problem

Adam and Anton are celebrating the second anniversary of failing their Math Logic exam. After a careful search in the local supermarket they bought a rectangular cake with integer side lengths ww and hh, and two candles. Place the cake on the plane so that its corners are (0,0)(0, 0), (w,0)(w, 0), (w,h)(w, h), and (0,h)(0, h).

Adam put the two candles at two different integer points strictly inside the cake and gave Anton a knife. Anton cuts the cake along one straight segment. The cut starts and ends at integer points on the sides of the cake, it must not touch either candle, and each of the two pieces must hold exactly one candle.

The figure shows a 7×37 \times 3 cake with candles at (2,2)(2, 2) and (3,2)(3, 2). The drawn cut goes through (0,0)(0, 0) and (4,3)(4, 3) and puts the candles in different pieces. Many cuts work, and the output section fixes which one to print.

Input

One line holds six integers ww, hh, axax, ayay, bxbx, byby. The side lengths of the cake are ww and hh, the first candle is at (ax,ay)(ax, ay), and the second candle is at (bx,by)(bx, by).

3w,h1093 \le w, h \le 10^9, 0<ax,bx<w0 < ax, bx < w, 0<ay,by<h0 < ay, by < h, and axbxax \ne bx or aybyay \ne by.

Output

Print four integers sxsx, sysy, exex, eyey on one line: the start point and the end point of the cut. Both points lie on the sides of the cake.

Many cuts satisfy the conditions, so print only the one fixed by this rule.

  • If axbxax \ne bx, let m=min(ax,bx)m = \min(ax, bx) and cut from (m,0)(m, 0) to (m+1,h)(m + 1, h).
  • If ax=bxax = bx, let m=min(ay,by)m = \min(ay, by) and cut from (0,m)(0, m) to (w,m+1)(w, m + 1).

This cut always satisfies the conditions above.