During class, Bob's teacher wanted to try an interesting activity. He began by writing down a string of length
Constraints
In all subtasks,
Subtask 1 [5%]
Subtask 2 [15%]
Subtask 3 [20%]
You only need to determine whether or not the teacher has made a mistake.
If there is a candidate for the original string, print out any string of length
Subtask 4 [60%]
No additional constraints.
Input Specification
The first line contains two space-separated integers,
Output Specification
On one line, output any string that the teacher could have written down. If there are multiple such strings, then output any of them.
If there are no candidates for the original string, output -1
.
Sample Input 1
5 3
obl
rob
lem
pro
ble
Sample Output 1
problem
Sample Input 2
2 5
abcde
cdefa
Sample Output 2
-1
Comments