시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB70635591.667%

문제

In this problem, a prefix of a string means a consecutive substring starting from its first character. For example, the prefixes of the string icpc are i, ic, icp, and icpc. Similarly, a suffix of a string means a consecutive substring ending at its last character. For example, the suffixes of the string icpc are icpc, cpc, pc, and c.

Given a string $s$, find the shortest string other than $s$ itself having $s$ as both its prefix and its suffix. It can be proven that such a string is unique.

입력

The input consists of at most $50$ test cases, each in the following format.

$n$

$s$

The first line contains an integer $n$ between $1$ and $50$, inclusive. The second line contains a string $s$ of length $n$, consisting of English lowercase letters.

The end of the input is indicated by a line consisting only of a zero.

출력

For each test case, output in a line the shortest string other than s having s as both its prefix and its suffix.

예제 입력 1

4
test
4
icpc
8
cccpppcc
1
i
9
strongest
3
ttt
0

예제 출력 1

testest
icpcicpc
cccpppcccpppcc
ii
strongestrongest
tttt