Each member of the sequence of decimal digits d_1, d_2, d_3, \ldots starting from the fourth is equal to the last digit of the sum of the previous three digits. Given d_1, d_2, d_3, find the -th term of the sequence.
The first line contains the digits d_1, d_2, d_3 separated by spaces. The second line contains the number .
1 \leq N \leq 10^{15}.
Print a single digit: d_N.
Example 1