#abc241a. [abc241_a]Digit Machine

[abc241_a]Digit Machine

Problem Statement

There is a device with a screen that shows a single-digit number, and a button.

When the screen is showing a number kk, pressing the button once changes the number on the screen to aka_k.

The device currently shows 00. After pressing the button 33 times, what will be shown on the screen?

Constraints

  • 0leqaileq90\\leq a_i \\leq 9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

a0a_0 a1a_1 dots\\dots a9a_9

Output

Print the answer.


Sample Input 1

9 0 1 2 3 4 5 6 7 8

Sample Output 1

7

The number on the screen transitions as 0rightarrow9rightarrow8rightarrow70 \\rightarrow 9 \\rightarrow 8 \\rightarrow 7.


Sample Input 2

4 8 8 8 0 8 8 8 8 8

Sample Output 2

4

The number on the screen transitions as 0rightarrow4rightarrow0rightarrow40 \\rightarrow 4 \\rightarrow 0 \\rightarrow 4.


Sample Input 3

0 0 0 0 0 0 0 0 0 0

Sample Output 3

0