At each step he chooses two numbers A and B and then reverses the subsequence between indices A and B(Both are 1-based).

M steps in total;

He wants to know the final text, please help him.

Submit: 30 Solved: 7

[Submit][Status][Web Board]

Wavator has a string(length N).

At each step he chooses two numbers A and B and then reverses the subsequence between indices A and B(Both are 1-based).

M steps in total;

He wants to know the final text, please help him.

At each step he chooses two numbers A and B and then reverses the subsequence between indices A and B(Both are 1-based).

M steps in total;

He wants to know the final text, please help him.

The first line is the initial text of length N (1 ≤ N ≤ 2500000).

The second line is M (1 ≤ M ≤ 3000).

Each of the following M lines contain two integer A and B (1 ≤ A ≤ B ≤ N).

The second line is M (1 ≤ M ≤ 3000).

Each of the following M lines contain two integer A and B (1 ≤ A ≤ B ≤ N).

In the first and only line output the final text.

```
wavator
3
1 7
3 5
1 5
```

`tavoraw`

Note the length of string and the amount of change.