Huge String

Time Limit: 3000ms
Memory Limit: 65535KB
This problem will be judged on HDU. Original ID: 4693
64-bit integer IO format: %I64d      Java class name: Main

Description

You can get a huge string from a tiny one S by repeating doing following replacement N times.

What's the substring containing M characters starting at the index K?

Input

There are multiple test cases. Process to the End of File.
The first line of each test contains the string S made up of nonspacing graphic characters, whose length doesn't exceed 100. The second line contains three integers: 0 ≤ N ≤ 100, 1 ≤ M ≤ 200 and 0 ≤ K ≤ 1081.

Output

For each test case, output the substring [K, min(length(S), K + M))

Sample Input

W
2 4 8
ACM-ICPC
1 8 0

Sample Output

W
ACM-ICPC

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .