Given two strings
and we define
to be their
concatenation. For example, if and then . If we
think of concatenation as multiplication, exponentiation by a
non-negative integer is defined in the normal way: (the empty string)
and .
Input
The input consists of up to test cases. Each test case is a
line of input containing , a string of lower case letters
(a-z). The length of
will be at least and
will not exceed characters. A line containing a period follows the
last test case.
Output
For each you should
print the largest such
that for some
string .
Sample Input 1 |
Sample Output 1 |
abcd
aaaa
ababab
.
|
1
4
3
|