Kings of Persia

No attempts yetTime limit2sMemory limit256 MB

Problem

Maya likes the kings of Persia. She wanted to know how long her favourite kings lived, so she started looking up records.

Exact birth years and death years survive for only a few of them. For the rest she found a range of years in which the birth happened and a range of years in which the death happened. Cyrus II was born between 600 BC and 575 BC and died in 530 BC, so he lived 45 years at the least and 70 years at the most.

Maya's list of birth ranges and death ranges is far too long to work through by hand. Read the list for her and report the smallest and the largest possible age of each king.

If a king was born in year xx and died in year yy, he lived yxy - x years.

Input

The input holds one test case per line. Each test case is four integers aa, bb, cc, dd (5000abcd2000-5000 \le a \le b \le c \le d \le 2000). [a,b][a, b] is the range of the birth year and [c,d][c, d] is the range of the death year. A negative year means BC. The input ends with a line of four zeros, which is not a test case.

Output

For each test case print the smallest age and the largest age on one line, separated by a space.

Hint

Year 0 does not exist in the real calendar, but this problem treats it as a real year.