Arithmetically Challenged#1186

Arithmetically Challenged

1 second
32 megabytes
Very easy

Challenge 24 is a popular mathematics game used in many grade schools. In each game, contestants are given a card with four positive integers i_1, i_2, i_3, i_4 on it, and the first one who can use all of these numbers and any combination of the four basic arithmetic operations to get 24 wins. Each of the numbers i_1, i_2, i_3, i_4 must be used exactly once. Division can be used only if the divisor evenly divides the dividend (i.e., you can perform but not ). For example, if the card contains the numbers , , , and , possible solutions are (7-2)\cdot5-1 or (7+1)\cdot(5-2). Hmmm... this sounds like a source of a good programming problem.

Write a program that determines the longest consecutive sequence of integers that can be obtained by combining the four integers using arithmetic operations. For example, with , , , and , the longest consecutive sequence is from to (yes, negative results are allowed). The "+" and "-" operators must be used as binary operators, not as unary signs.

Input

Each test case will consist of a single line containing four, not necessarily distinct, positive integers, none of which will exceed . A line containing four 's will terminate input and should not be processed.

Output

For each test case, output the case number and the longest consecutive sequence in the format shown in the sample output. If there is more than one longest consecutive sequence, use the one with the largest first value.

Examples

Example 1

Loading
Loading