#00065C

P-Portal

Chell has decided to dedicate herself once again to solving logical mind-benders with portals, after a long break. This time she has decided to visit the ancient test chambers which GLaDOS has constructed as early as the year 2215.


The conclusion is obvious - tests used to be much harder to solve. Chell is on the first test and she is already struggling. She quickly logged in to Z-Training and asked for your help.


The test consists of the following: She is given a text. Among its letters there are N portals, 26 Aperture Science 1500 Megawatt Heavy Duty Super-Colliding Super Buttons, and a single Aperture Science Weighted Storage Cube. Chell quickly realised that each button corresponds to a single character of the english alphabet, and that the buttons together can be considered as some kind of "keyboard". By placing the cube on any button, the character that it corresponds to gets printed on the screen. Chell is asked to write how will the given text look once the portals are activated. As soon as Chell writes a text of the given length, all portals get activated instantly. An activated entry portal will suck in all the text's characters that it can (until the first portal it encounters), and then release them through the corresponding exit portal, in the same order in which they are sucked in.


In case that two portals want to suck in the same block of text, weird kinds of quantum tunnel-effects completely mutilate that text and it doubles, such that one of the new "twins" goes through the first portal, and the other through the second. It's equivalent to both portals sucking in that block.


Failing to write the correct text in the first try will result in an unsatisfactory mark on Chell's performance review, followed by death. Help her solve this problem.


InputFrom the first line of the standard input read the integer N (1 <= N < 10), which represents the amount of portals. From the second line, input the given text. It will have no more than 100000 characters and will only consist of:
- lowercase letters of the English alphabet;
- characters '/' and '\\', where the character '/' corresponds to a portal whose force field is to the right, and '\\' to a portal whose force field is on the left;
- numbers in the interval [1,N], which will be right to each character '/' and '\\' and will be the unique identifier of that portal.
If a portal's identifier is an odd number, the first one encountered from the left will be considered the entry portal, and other the exit portal. If the identifier is even, the first encountered portal from the left is the exit one, and the second one is the entry.

OutputWrite to the standard output the requested result, the way the text will look after all portals have been activated.

Input:
2
abc/1ef/2gh\2ijk/1

Output:
abcghijkfe
Explanation: The first portal will suck in the characters 'e' and 'f', and expel them at the end of the text in that same order. The second portal does not disturb the original order of the letters 'g' and 'h'.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.