#Q1206A. Choose Two Numbers
Choose Two Numbers
Choose Two Numbers
题面翻译
设有两个正整数数列和,长度分别为和。试从两个数列中各找一个元素,使得这两个元素的和均不出现在原来的两个数列中。
可以证明有解。输出任意一组解即可。
保证,数列元素均在间。
题目描述
You are given an array , consisting of positive integers , and an array , consisting of positive integers .
Choose some element of and some element of such that doesn't belong to and doesn't belong to .
For example, if and , we can choose from and from , as number doesn't belong to and doesn't belong to . However, we can't choose from and from , as belongs to .
It can be shown that such a pair exists. If there are multiple answers, print any.
Choose and print any such two numbers.
输入格式
The first line contains one integer ( ) — the number of elements of .
The second line contains integers ( ) — the elements of .
The third line contains one integer ( ) — the number of elements of .
The fourth line contains different integers ( ) — the elements of .
It can be shown that the answer always exists.
输出格式
Output two numbers and such that belongs to , belongs to , but doesn't belong to nor neither .
If there are multiple answers, print any.
样例 #1
样例输入 #1
1
20
2
10 20
样例输出 #1
20 20
样例 #2
样例输入 #2
3
3 2 2
5
1 5 7 7 9
样例输出 #2
3 1
样例 #3
样例输入 #3
4
1 3 5 7
4
7 5 3 1
样例输出 #3
1 1
提示
In the first example, we can choose from array and from array . Number doesn't belong to any of those arrays. However, it is possible to choose from the second array too.
In the second example, we can choose from array and from array . Number doesn't belong to any of those arrays.
In the third example, we can choose from array and from array . Number doesn't belong to any of those arrays.