#ABC4062. Product Calculator

Product Calculator

Problem Statement

Takahashi has a calculator that initially displays 1. He will perform NN operations on the calculator. In the i-th operation (1iN)(1≤i≤N), he multiplies the currently displayed number by a positive integer Ai . However, the calculator can display at most K digits. If the result of the multiplication has (K+1)(K+1) or more digits, the display shows 1 instead; otherwise, the result is shown correctly.

Find the number showing on the calculator after the N operations.

Constraints

1N1001≤N≤100 1K181≤K≤18 1Ai<10K1≤A_i<10^K All input values are integers.

Input

The input is given from Standard Input in the following format:

NKN_K A1A2ANA_1 A_2 … A_N

Output

Output the number shown on the calculator after the NN operations.

Sample Input 1

5 2
7 13 3 2 5

Sample Output 1

10

This calculator can display at most two digits and initially shows 1. Takahashi operates as follows:

The 1st operation multiplies by 7. Since 1×7=7, the calculator shows 7. The 2nd operation multiplies by 13. Since 7×13=91, the calculator shows 91. The 3rd operation multiplies by 3. Since 91×3=273, which has three digits, the calculator shows 1. The 4th operation multiplies by 2. Since 1×2=2, the calculator shows 2. The 5th operation multiplies by 5. Since 2×5=10, the calculator shows 10.

Sample Input 2

2 1
2 5

Sample Output 2

1