Question
Decode Challenge
In a bustling city, two young coders, Mia and Leo, were always solving puzzles together. One day, Mia stumbled upon a mysterious encoded message. It followed a pattern: k{encodedString}, where the part inside the curly brackets repeated exactly k times, and k was always a positive number. Intrigued, Mia challenged Leo to decode the message. Now, Leo turns to you for help. Can you figure out how to decode the string and crack the code?
Input
The first line of the input contains a single string S, denoting the encoded string.
Constraints
1 ≤ |S| ≤ 30
Constraints
1 ≤ |S| ≤ 30
Output
You just need to print the decoded string.
Example
Sample Input
3{a}
Sample Output
aaa
Explanation
As the string received in functional parameters will be 3{a} you need to decode it as 3{a} means 3 times a will be repeated, so the resulting string is aaa. You don't need to print the result rather you need to return the string.
Sample Input
3{abc2{d}}
Sample Output
abcddabcddabcdd
3{a}
Sample Output
aaa
Explanation
As the string received in functional parameters will be 3{a} you need to decode it as 3{a} means 3 times a will be repeated, so the resulting string is aaa. You don't need to print the result rather you need to return the string.
Sample Input
3{abc2{d}}
Sample Output
abcddabcddabcdd