Obtain The String

easy
<a href="https://codeforces.com/problemset/problem/1295/C" target="_blank"><i class="fa fa-external-link" aria-hidden="true"> Link -> Obtain The String</i></a>

Input Format

check the link

Output Format

check the link

Constraints

check the link

Example

Input
3
aabce
ace
abacaba
aax
ty
yyt
Output
1
-1
3
Previous
Test
Next
Max Min 2

Related Questions