Given three arrays , , of length , Bobo defines a cryptographic function where
He also has questions .
For each , find a pair of integers where and . It is guaranteed that for each , there exists a unique pair satisfying the condition.
Note: denotes the bitwise exclusive-or, i.e., xor.
输入
Note from SCNUOJ admin: we don't have the official test data sets, and all tests used here are randomly generated, so expect weak tests and/or even wrong input format. Contact one of the admins if you wish to improve the tests.
The input consists of several test cases terminated by end-of-file. For each test case,
The first line contains two integers and .
The second line contains integers .
The third line contains integers .
The forth line contains integers .
For the following lines, the -th line contains two integers and .
输出
For each question, output two integers which denote the found and .
样例
标准输入 复制文本 |
2 2 0 1 2 3 1 2 3 0 2 3 0 1 0 1 2 3 1 1 0 0 0 0 0 0 0 0 |
标准输出 复制文本 |
3 0 1 2 0 0 |
标准输入 复制文本 |
1 1 0 0 0 0 0 0 0 0 |
标准输出 复制文本 |
0 0 |
来源
第六届中国大学生程序设计竞赛总决赛