SMPCPH1 - Substitution cipher

You are given a sequence of n characters S = s1, s2, ..., sn in such a way that for ij we have also sisj. Your task is to substitute every si with si+1 for i in {1, 2, ... n-1} and sn with s1 in the given plain text.

Input

In the first line you are given one integer 2<=n<=26, and in the following line n characters.

In the third line you are given one integer 2<=m<=100, and in the following m lines you are given a plaintext to be encoded. Plaintext contains only white spaces and small letters from the Latin alphabet. The whole plain text is at most 1000 characters long.

Output

Encoded text, as specified above.

Example 1

```Input:
6
spojit
3
after this training
we will solve even
difficult and tricky problems easily

Output:
afser shtp sratntng
we wtll pjlve even
dtfftculs and srtcky orjblemp eaptly
```

Example 2

```Input:
10
dontgiveup
3
after this training
we will solve even
difficult and tricky problems easily

Output:
afgur ghvs gravtvti
wu wvll snleu ueut
ovffvcplg ato grvcky drnblums uasvly

```