문제
The cows are experimenting with secret codes, and have devised a method for creating an infinite-length string to be used as part of one of their codes.
Given a string
Given the initial string and an index
Problem credits: Brian Dean
입력
The input consists of a single line containing a string followed by
Note that
출력
Please output the
예제
COW 8
C
In this example, the initial string COW expands as follows:
COW -> COWWCO -> COWWCOOCOWWC
12345678