In this simple word game a series of words is given. By selecting certain letters from the words you can form a new word.

Input

The first line of the input contains an integer $$t \in \mathbb{N}$$ indicating out of how many letters the word you are looking for consists. This is followed by $$t$$ lines with a single word and one number. These are separated by a single space. The number is the position of the letter to be selected, where the first letter is indicated as position 1 in the word. You may assume that the word is always long enough.

Output

The output consists of a single line that contains the word formed with the selected letters.

Example

Input:

6
and 3
now 2
for 2
something 7
completely 8
different 6

Output:

dooier