#abc284f. [abc284_f]ABCBAC

[abc284_f]ABCBAC

Problem Statement

For a string SS of length NN and an integer i(0leqileqN)i\\ (0\\leq i\\leq N), let us define the string fi(S)f_i(S) as the concatenation of:

  • the first ii characters of SS,
  • the reversal of SS, and
  • the last (Ni)(N-i) characters of SS,

in this order. For instance, if S=S= abc and i=2i=2, we have fi(S)=f_i(S)= abcbac.

You are given a string TT of length 2N2N. Find a pair of a string SS of length NN and an integer i(0leqileqN)i\\ (0\\leq i\\leq N) such that fi(S)=Tf_i(S)=T. If no such pair of SS and ii exists, report that fact.

Constraints

  • 1leqNleq1061\\leq N \\leq 10^6
  • NN is an integer.
  • TT is a string of length 2N2N consisting of lowercase English letters.

Input

The input is given from Standard Input in the following format:

NN TT

Output

If no pair of SS and ii satisfies the condition, print -1. Otherwise, print SS and ii, separated by a newline. If multiple pairs of SS and ii satisfy the condition, you may print any of them.


Sample Input 1

3
abcbac

Sample Output 1

abc
2

As mentioned in the problem statement, if S=S= abc and i=2i=2, we have fi(S)=f_i(S)= abcbac, which equals TT, so you should print abc and 22.


Sample Input 2

4
abababab

Sample Output 2

abab
1

S=S= abab and i=3i=3 also satisfy the condition.


Sample Input 3

3
agccga

Sample Output 3

cga
0

S=S= agc and i=3i=3 also satisfy the condition.


Sample Input 4

4
atcodeer

Sample Output 4

-1

If no pair of SS and ii satisfies the condition, print -1.