Dragon Curve Junior#2866

Dragon Curve Junior

1 second
64 megabytes
Very easy

The dragon curve is an infinite sequence of connected segments, each of unit length, constructed in the following manner. Begin by selecting a point on the plane (for example, ), and choose one of the four directions parallel to the coordinate axes. The left (or right) dragon of order is constructed as follows:

Since the left dragon of order begins with the left dragon of order n-1, the left dragon of infinite order is well-defined. This sequence of segments is called the dragon curve.

Let us construct dragon curves starting from point in all four directions. According to a theorem proved by D. Knuth, these curves do not intersect (except at their vertices) and completely cover the integer grid on the plane. In this problem, you are required to check this theorem: given a unit grid segment, determine which of the four dragon curves it belongs to.

Input

The single line of the input contains integers: the coordinates of one endpoint of a segment parallel to one of the coordinate axes, followed by the coordinates of the other endpoint.

All numbers do not exceed 10^9 in absolute value. The distance between the points is .

Output

On the first line of the output, print the number of the dragon curve to which this segment belongs ( for the dragon in the positive direction, for the positive direction, for the negative direction, for the negative direction). On the second line, print the index of this segment in the corresponding dragon curve. It is guaranteed that this number does not exceed 10^7.

Examples

Example 1

Loading
Loading