https://codeforces.com/problemset/problem/1512/E
Input Format
Check Link
Output Format
Check Link
Constraints
Check Link
Example
Input
5 5 2 3 5 5 3 4 1 3 1 2 4 2 2 2 2 2 1 1 3
Output
1 2 3 4 5
-1
1 3 2
1 2
-1
https://codeforces.com/problemset/problem/1512/E
Check Link
Check Link
Check Link
5 5 2 3 5 5 3 4 1 3 1 2 4 2 2 2 2 2 1 1 3
1 2 3 4 5
-1
1 3 2
1 2
-1