Олимпиадный тренинг

Задача 44504. frogs


Задача

Темы: Разбор случаев

Three frogs sit on a number line at three different points with integer coordinates ab, c. The frogs are afraid to retreat too far from each other, so only one of the extreme frogs (such that there are no other frogs to the left or right of it) can jump, and only to an integer point between the other two frogs, if there is one. Note that in some positions none of the frogs can jump, let's call them stable .

It is required, given the initial position of the frogs, to determine the minimum and maximum number of jumps that the frogs can make until they get to some stable position.



Input

Three lines contain three different integers - ab, c (1 < = ab, c <= 1018), frog starting positions .

Please note that the input data can be larger than the possible value of a 32-bit integer variable, so you must use 64-bit integer data types (int64 type in Pascal, long long type in C and C++, long type in Java and C#). Python will work correctly with the int type as well.


Output

Print two numbers -  the minimum and maximum number of jumps it takes frogs to reach a stable state.

 

Note

In the first example from the condition, the frog from position 4 can jump to position 2 and form a stable position (1,2,3). It can be shown that they cannot make more than one jump.

In the second test from the condition, the frog from position 1 can jump to position 4, and then the frog from position 10 can jump to position 3, thereby coming to a stable position (2,3,4)  for two jumps. It can be shown that the frogs could not make more 7 jumps according to the described rules.

In the third test, the frogs are already in a stable position, so they won't be able to jump.

In the fourth test from the condition, the frog from position 1 can jump to position 4, and then the frog from position 5 can jump to position 3, thereby arriving at position (2,3,4) in two jump. It can be shown that frogs could not make more than two jumps.

 
Examples
# Input Output
1
1
3
4
1
1
2
1
10
2
2
7
3
1
2
3
0
0
4
2
1
5
2
2