An encoded string (s) is given, the task is to decode it. The pattern in which the strings were encoded were as follows
original string: abbbababbbababbbab
encoded string : "3[a3[b]1[ab]]".
The first line of input contains an integer T denoting the no of test cases. Then T test cases follow. Each test case contains a string s.
For each test case in a new line print the required decoded string.
1<=length of the string <=30
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.