#K45392. Decode String

    ID: 27743 Type: Default 1000ms 256MiB

Decode String

Decode String

You are given an encoded string which follows the format \( k[encoded\_string] \), where k is a positive integer and encoded\_string is enclosed in square brackets. The encoding rule is: the enclosed string is repeated k times.

Your task is to decode the string and output the decoded result. Note that the encoding can be nested, meaning that the encoded\_string inside the brackets may contain other encoded strings.

For example, given the string "3[a2[c]]", the decoded string is "accaccacc".

inputFormat

The input consists of a single line containing the encoded string. The string can be empty.

Input Format: Read from standard input (stdin).

outputFormat

Output the decoded string to standard output (stdout).

## sample
3[a]
aaa