#C2887. Decode Encoded String
Decode Encoded String
Decode Encoded String
You are given an encoded string. The encoding rule is: \( k[\text{encoded_string}] \), where the \( \text{encoded_string} \) inside the square brackets is repeated exactly \( k \) times. Note that \( k \) is a positive integer. Your task is to decode the string and output the decoded result.
Examples:
- Input:
3[a]
→ Output:aaa
- Input:
2[abc]3[cd]ef
→ Output:abcabccdcdcdef
- Input:
3[a2[c]]
→ Output:accaccacc
The input string's length satisfies \(1 \leq |s| \leq 30\).
inputFormat
The input consists of a single line which is the encoded string \( s \) to be decoded.
outputFormat
Output the decoded string.
## sample3[a]
aaa