SP28179 GOC11A - Appending String

Description

You are given a string S, you need to build another string T by expanding S according to the steps below (traversing left to right): 1. If current character is an alphabet, append it to T. 2. If current character is a digit, suppose the digit is N, then do T = N\*T. Here N\*T means appending T N times. See sample for better understanding. 3. Go to next character if exists then restart from step 1. Upon expanding S, you will be given Q queries. For each query you have to print the i $ _{th} $ character of the string T. Hint : After expanding the string S=”a3b2c1” T will be = “aaabaaabc”

Input Format

The first line will be the test case number(t

Output Format

N/A