TEST DATA FOR `codes'

A Zip file of this data is available.

Input for test 1

4
a c
b w
c t
l a
hello, i'm butch!

Output for test 1

heaao, i'm wutth!

Input for test 2

3
a b
b c
c a
abc

Output for test 2

bca

Input for test 3

4
h a
e b
l c
o d
hello

Output for test 3

abccd

Input for test 4

0
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Output for test 4

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Input for test 5

26
z a
y z
x y
w x
v w
u v
t u
s t
r s
q r
p q
o p
n o
m n
l m
k l
j k
i j
h i
g h
f g
e f
d e
c d
b c
a b
a b c d e f g h i j k l m n o p q r s t u v w x y z

Output for test 5

b c d e f g h i j k l m n o p q r s t u v w x y z a

Input for test 6

30
a a
b b
c c
d d
e e
f f
g g
h h
i i
j j
k k
l l
m m
n n
o o
p p
q q
r r
s s
t t
u u
v v
w w
x x
y y
z z
< <
> >
? ?
! !
%

Output for test 6

%

Input for test 7

30
# n
d q
q i
n k
l o
s j
m v
f e
p r
k t
a $
j x
w a
z m
o c
c y
! z
i w
g g
e u
x d
h h
v f
u l
b b
y @
r p
@ !
$ s
t #
gallia est omnis divisa in partes tres, quarum unam incolunt belgae, aliam aquitani

Output for test 7

g$oow$ uj# cvkwj qwfwj$ wk r$p#uj #puj, il$plv lk$v wkycolk# buog$u, $ow$v $ilw#$kw

Input for test 8

30
m x
# $
l u
r b
p s
n !
f k
a d
q m
x j
d y
c @
h t
! f
v l
k i
t g
g w
w #
@ o
y z
j q
o a
s h
b p
z r
$ n
e e
u c
i v
tertiam, qui ipsorum lingua celtae, nostra galli appellantur. hi omnes lingua, instutis, legibus, in

Output for test 8

gebgvdx, mcv vshabcx uv!wcd @eugde, !ahgbd wduuv dsseuud!gcb. tv ax!eh uv!wcd, v!hgcgvh, uewvpch, v!