Problem B: 华小科的旅行开始了

Problem B: 华小科的旅行开始了

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

Input

Output

Sample Input Copy

3 3 1 1
1 2 1 3 2 1
2 2 0 0 2 3
3 2 3 3 1 1

Sample Output Copy

1 1
1 2
1 3
2 1
2 2

HINT