Cryptography
시간 제한1초메모리 제한1024 MB
크기가 2^m인 배열 f, g, h로 정의되는 암호화 함수의 출력 쌍이 주어질 때, 각 출력에 대응하는 유일한 (x, y)를 복원한다.
문제
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.
입력
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 .
제한
- for each
- for each
- In each input, the sum of does not exceed . The sum of does not exceed .