You can find your lucky number of the day in the following way.
Prepare four bowls and plenty of marbles.
Line up the bowls from left to right, and, after deep meditation,
put some arbitrary numbers of marbles in the bowls.
Numbers of marbles in the bowls may vary;
some bowls may be empty, but at least one of them should be nonempty.
Among nonempty bowls, choose one with the least number of marbles in it.
If more than one bowl has the least number of marbles, choose the leftmost.
From all the other nonempty bowls,
remove the same number of marbles as in the chosen bowl.
The marbles in the chosen bowl are left there.
This procedure should be repeated until only one nonempty bowl remains.
The number of marbles in the nonempty bowl is your lucky number today.
The figure to the right shows an example corresponding to the first
dataset of the Sample Input.

The bowl second from the right contains the least number of
marbles, four.

Four marbles each have been taken out from other bowls.
Now the rightmost bowl has two marbles, which are the least.

Two marbles each have been taken out from other bowls.
Three bowls except the leftmost have two marbles,
which are the least.
The leftmost bowl of the three, that is, the second from the left,
is chosen.

Two marbles each have been taken out from other bowls.
Now only two bowls have marbles in them and both have two marbles.
Thus, the leftmost bowl is chosen.

Two marbles from the second bowl have been taken out,
leaving only one bowl nonempty,
which is the leftmost bowl with two marbles.
Yes, your lucky number of the day is two!
The input consists of multiple datasets, each in the following format.
a_{1} a_{2}
a_{3} a_{4}
Each of the datasets consists of one line containing four integers,
a_{1} through a_{4}.
These four integers are the numbers of marbles
initially in the four bowls.
All of these four integers are between 0 and 100, inclusive,
and at least one of them is nonzero.
The end of the input is indicated by a line containing four zeros.
The number of datasets does not exceed 100.