1104: Vector II

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:431 Solved:287

Description

Input

 

Output

 

Sample Input Copy

3 13
0 0 1
0 0 2
0 0 3
0 1 -1
0 2 4
0 2 5
1 0
1 1
1 2
2 1
1 0
1 1
1 2

Sample Output Copy

1 2 3
-1
4 5
1 2 3

4 5

HINT