We are going to construct an infinite sequence of digits as follows. Begin with three given digits. Each subsequent digit is obtained by summing the last three digits of the sequence and appending the digits of the result to the sequence. For example, the digits 123 generate the infinite sequence starting with 12361181091010, while 971 produces the sequence starting with 971179171715. Consider this sequence as the fractional part of a certain decimal fraction (the integer part can be considered zero). Write a program that reads the first three digits of two such sequences and prints the -th digit of the fractional part of the sum of the two decimal fractions formed from the input.
The input file contains the first three digits of the first sequence on the first line, and the first three digits of the second sequence on the second line. After that, there is one or more lines, each containing an integer N_i (1 \leq N_i < 10^{100}, 1 \leq i \leq 20).
For each N_i, output a line containing the N_i-th digit of the fractional part of the sum of the two decimal fractions based on the input data.
Example 1