Xoring Machine#6448

Xoring Machine

1 second
128 megabytes
Easy

Consider a sequence of positive integers: x_1, x_2, \dots, x_n. You are allowed to perform the following operations on this sequence:

You are given an initial sequence x_1, x_2, \dots, x_n, as well as a string of operations consisting of the letters , , and repetition commands. A repetition command has the format , where T~(1 \le T \le 10^6) is an integer and the parentheses enclose a non-empty substring of operations. This means that the sequence of operations inside the parentheses must be executed exactly times.

Perform all the given operations on the initial sequence and print the resulting sequence.

Input

The first line contains a single integer n~(1 \le n \le 30000) — the length of the sequence.

The second line contains integers x_i~(0 \le x_i \le 10^9) — the elements of the initial sequence.

The third line contains the operation string in the format described above. It is guaranteed that the length of this string does not exceed 10^5 characters.

It is also guaranteed that the total number of operations after expanding all repetitions does not exceed 10^{18}.

Output

Print the resulting sequence x_1, x_2, \dots, x_n after applying all specified operations.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading