A. Challenges in Bolivia (challenges)
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
Input
3 4
1 3 3
5 2 3 1
4 1 2 0
Output
2 1 3 
Input
6 4
11 20 14 30 5 1
1 2 4 5
0 3 4 1
Output
-1