Permutation By Sum

medium
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
    
Previous
Cells Not Under Attack
Next
Two Arrays And Sum Of Functions

Related Questions