{"raw_statement":[{"iden":"problem statement","content":"For a string $S$ of length $N$ and an integer $i\\ (0\\leq i\\leq N)$, let us define the string $f_i(S)$ as the concatenation of:\n\n*   the first $i$ characters of $S$,\n*   the reversal of $S$, and\n*   the last $(N-i)$ characters of $S$,\n\nin this order. For instance, if $S=$ `abc` and $i=2$, we have $f_i(S)=$ `abcbac`.\nYou are given a string $T$ of length $2N$. Find a pair of a string $S$ of length $N$ and an integer $i\\ (0\\leq i\\leq N)$ such that $f_i(S)=T$. If no such pair of $S$ and $i$ exists, report that fact."},{"iden":"constraints","content":"*   $1\\leq N \\leq 10^6$\n*   $N$ is an integer.\n*   $T$ is a string of length $2N$ consisting of lowercase English letters."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ \n$T$"},{"iden":"sample input 1","content":"3\nabcbac"},{"iden":"sample output 1","content":"abc\n2\n\nAs mentioned in the problem statement, if $S=$ `abc` and $i=2$, we have $f_i(S)=$ `abcbac`, which equals $T$, so you should print `abc` and $2$."},{"iden":"sample input 2","content":"4\nabababab"},{"iden":"sample output 2","content":"abab\n1\n\n$S=$ `abab` and $i=3$ also satisfy the condition."},{"iden":"sample input 3","content":"3\nagccga"},{"iden":"sample output 3","content":"cga\n0\n\n$S=$ `agc` and $i=3$ also satisfy the condition."},{"iden":"sample input 4","content":"4\natcodeer"},{"iden":"sample output 4","content":"\\-1\n\nIf no pair of $S$ and $i$ satisfies the condition, print `-1`."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}