The objective of the numbers game is to use the basic arithmetic operations (, , , and ) and a given set of integers (from to integers) to get as close as possible to a given target integer. Each operation may be used multiple times, but each integer may be used at most once. A player wins by calculating the closest possible value to the target integer. For example, the closest value to a target of using the integers \{2, 3, 5\} can be achieved by the expression (2 + 5) * 3.
Your task is to write a program to calculate the answer for each game. Note that "" denotes integer division (for example: 5 / 4 = 1, 8 / 9 = 0).
The input consists of many games. Each game is described in two lines. The first line contains two integers and separated by a space, representing the target integer and the number of given integers. -700000 < T < 700000 and 4 < N < 7. The second line contains integers separated by spaces. All integers are between and , inclusive.
Two zeros on a line by themselves, separated by a space, indicate the end of the input.
For each game, output a single line containing the integer closest to the target. Any answer with the minimal distance to the target is correct.
Example 1