Digo is popular among girls after his success in ACM. He has got a lot of girls lined up for him and he is confused in choosing any one of them.As he has full opportunity of dating anyone of them he wants to date everyone starting from the lightest girl to the fattest one.Help digo arrange girls for him so that he could date all of them as per their weights.

**Input:**

t number of test cases followed by t lines each having a number n representing the total girls in a particular test case followed by girls with their weight in the format [girlnameweight] where weight is represented by w.Girl name is a string containing small letters only.

**Output:**

Your output should contain t parts each having n girls name arranged in the desired order.
two adjacent cases should be separated by a line.

**Constraints:**

1<=t<=3

2<=n<=10^5

1<=w<=10^8

1<=g<=10

g is the length of the name of the girls

**Sample Input:**

1

3 marilyn 4 angelina 1 megan 2

**Sample Output:**

angelina 1

megan 2

marilyn 4