#P7699. [2019年杭电多校]three arrays
[2019年杭电多校]three arrays
three arrays
Problem Description
There are three integer arrays . The lengths of them are all . You are given the full contents of and . And the elements in is produced by following equation: where is the bitwise exclusive or operation. Now you can rearrange the order of elements in arrays and independently before generating the array . We ask you to produce the lexicographically smallest possible array after reordering and . Please output the resulting array .
Input
The first line contains an integer indicating there are tests. Each test consists of three lines. The first line contains one positive integer denoting the length of arrays . The second line describes the array . The third line describes the array .
- integers in arrays and are in the range of .
- at most tests with
Output
For each test, output a line containing integers, representing the lexicographically smallest resulting array .
Sample Input
1
3
3 2 1
4 5 6
Sample Output
4 4 7
Source
2019 Multi-University Training Contest 5