The cows are experimenting with secret codes and have devised a method for generating an infinite string to use as part of one of their codes.
Given a string , let be the concatenation of and a copy of rotated one character to the right. In a right rotation, the last character of moves to the beginning, and all other characters shift one position to the right.
Starting with an initial string , the cows construct their infinite code string by repeatedly applying . Each application of doubles the length of the current string.
Given the initial string and an index , help the cows determine the character at the -th position of the resulting infinite code string.
Consists of one line containing a string followed by n~(n \le 10^{18}). The string consists of at most uppercase English letters.
Print the -th character of the infinite code string generated from the initial string. The first character is at position .
In this example, the initial string COW expands as follows:
COW -> COWWCO -> COWWCOOCOWWC
12345678Example 1