{"trustable":true,"sections":[{"title":"","value":{"format":"MD","content":"Consider a sequence consisting of **n** positive integers: `x[1]`, `x[2]`, ..., `x[n]`. You can perform the following operations with this sequence:\r\n\r\n1. For each **i** from **2** to **n** in increasing order, set `x[i]` \u003d `x[i]` **xor** `x[i-1]`. Denote this operation as \"**L**\".\r\n2. For each **i** from **n** to **2** in decreasing order, set `x[i]` \u003d `x[i]` **xor** `x[i-1]`. Denote this operation as \"**R**\".\r\n\r\nYou are given an initial sequence `x[1]`, `x[2]`, ..., `x[n]` and a string of operations which consists of \"**L**\", \"**R**\" and repeat commands. A repeat command looks like \"**T(...)**\", where **T** (**1** ≤ **T** ≤ `10^6`) is an integer and the brackets contain an arbitrary non-empty string of operations. It means that you must apply the string in brackets **T** times.\r\n\r\nApply all the operations to the initial sequence and print the result.\r\n\r\n#### Input\r\nThe first line contains the length **n** (**1** ≤ **n** ≤ **30000**) of the initial sequence.\r\n\r\nThe second line contains **n** integers `x[i]` (**0** ≤ `x[i]` ≤ `10^9`). The third line contains a string of operations formatted as described above. It is guaranteed that this string contains no more than **100000** characters. Also it is guaranteed that the number of operations after expanding all repeat commands will be no more than `10^18`.\r\n\r\n#### Output\r\nPrint in one line the resulting sequence `x[1]`, `x[2]`, ..., `x[n]` after performing the given sequence of operations."}},{"title":"Example","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 2 3 4\nLLRL\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 2 6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr\u003e\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\n8 2 1 4 16\n3(L)2(R)LR4(L2(R))\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e8 10 11 15 23\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}