Alphabet | 프로그래밍의 벗 PivotOJ
PivotOJ

Alphabet

시간 제한: 2000ms메모리 제한: 64MB출처: NEERC Northern Subregional 2006BOJ 3615
이 문제는 본문 이미지 일부가 표시되지 않습니다. 텍스트만으로 풀이가 어려울 수 있습니다.

문제

Johnny is a little boy, and now he is learning alphabet. His father made him a birthday present — a large collection of tokens, each marked with a letter from ‘A’ to ‘Z’, and Johnny invented an interesting game to help himself learning.

First, Johnny takes several tokens and puts them in a circle. After that he selects one of the tokens to start the game at, and chooses some number k. Each turn Johnny counts k tokens along the circle to find the next winning token and inserts another token to the circle immediately after it. This new token must hold the letter which follows alphabetically the letter written on the winning token, i.e. ‘B’ is inserted if the winning token is ‘A’, ‘C’ is inserted after ‘B’, etc. If the winning token is ‘Z’, the token ‘A’ is inserted. There are so many tokens available that Johnny can always find one with the required letter.

After inserting the token Johnny proceeds to another game turn, this time starting from the newly inserted token. The number k is only selected once and is not changed between turns. The first four turns of a sample game with initial tokens ‘J’, ‘O’, ‘H’, ‘N’, ‘N’, ‘Y’ (‘J’ is the starting one) and k = 3 are shown on a figure below:

[이미지 1]

Georgie is Johnny’s elder brother. Since he is already a schoolboy, he plays the same game mentally and astonishes Johnny with his ability to predict the letter inserted at turn i. But as Johnny gets smarter and makes more and more turns, it becomes harder for Georgie to compete, so he decides to write a computer program to find the results quickly.

입력

The first line of the input file contains three integers: n — the number of tokens initially placed in a circle (1 ≤ n ≤ 10 000), k — the number of tokens counted each turn (1 ≤ k ≤ 10 000), and m — the number of turns (1 ≤ m ≤ 109).

The second line contains a string of n uppercase letters (‘A’ to ‘Z’) — the tokens initially placed in a circle, starting from the initial token.

출력

Output a single uppercase English letter which is added to the circle at the m-th turn.

예제

예제 1

입력
6 3 4
JOHNNY
출력
Z
코드를 제출하려면 로그인하세요.