The Maximum Term According to multinomial theorem we can write:

(a +a +...+a )n = 1 2 k ∑ n! n1,n2,...,nk ≥ 0 n1 + n2 + . . . + nk = n an1an2 ···ank, n1!n2!···nk!1 2 k When the value of k is 4 and the four variables within the bracket are w, x, y and z we get tetranomial theorem which can be written as (w + x + y + z)n = ∑ n! i,j,k,l ≥ 0 i+j+k+l=n i!j!k!l!wixjykzl You can see that right hand side of this equation is a summation of many terms. If the values of w, x, y, z and n are given, then all these terms will have a value. In this problem your job is to find the value of the term with maximum value. Input The input file contains at most 300 lines of input. Each line contains five integers n (5 ≤ n ≤ 300), w, x, y, z(0 < w, x, y, z < 301). These five integers are the values of the five parameters of the tetranomial theorem above. Input is terminated by a line where the value of all five parameters are zero. This line should not be processed. Output For each line of input produce one line of output. This line contains at most eight digits. These eight digits are the eight least significant digits (excluding the trailing zeroes) of the value of the highest valued term. If the number is too small to have eight such digits print all that are available (excluding the trailing zeroes). Sample Input 82222 100 20 20 20 20 250 1 2 3 4 6 10 10 10 10 00000 Sample Output 64512 74049024 89901568 18