#C1001. GHCSC Lesson 5 Dictionary Exercise 4

GHCSC Lesson 5 Dictionary Exercise 4

Write a function reverse_dict(d) that swaps the keys and values of a dictionary. Assume all values are unique.

INPUT FORMAT

First line contains an integer N(N<=100)N (N <= 100) From the second line to the N+1N + 1 line, each line contains a key and a value, separated by a blank space.

OUTPUT FORMAT

Ouput NN lines, each line contains a key and a value, separated by a blank space. The key should be outputed in the dictionary order.

SAMPLE

INPUT

3
a c
b d
c e

OUTPUT

c a
d b
e c