#Q1206A. Choose Two Numbers

Choose Two Numbers

Choose Two Numbers

题面翻译

设有两个正整数数列AABB,长度分别为nnmm。试从两个数列中各找一个元素,使得这两个元素的和均出现在原来的两个数列中。

可以证明有解。输出任意一组解即可。

保证1n,m1001\leq n,m\leq 100,数列元素均在(0,200](0,200]间。

题目描述

You are given an array A A , consisting of n n positive integers a1,a2,,an a_1, a_2, \dots, a_n , and an array B B , consisting of m m positive integers b1,b2,,bm b_1, b_2, \dots, b_m .

Choose some element a a of A A and some element b b of B B such that a+b a+b doesn't belong to A A and doesn't belong to B B .

For example, if A=[2,1,7] A = [2, 1, 7] and B=[1,3,4] B = [1, 3, 4] , we can choose 1 1 from A A and 4 4 from B B , as number 5=1+4 5 = 1 + 4 doesn't belong to A A and doesn't belong to B B . However, we can't choose 2 2 from A A and 1 1 from B B , as 3=2+1 3 = 2 + 1 belongs to B B .

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 n n ( 1n100 1\le n \le 100 ) — the number of elements of A A .

The second line contains n n integers a1,a2,,an a_1, a_2, \dots, a_n ( 1ai200 1 \le a_i \le 200 ) — the elements of A A .

The third line contains one integer m m ( 1m100 1\le m \le 100 ) — the number of elements of B B .

The fourth line contains m m different integers b1,b2,,bm b_1, b_2, \dots, b_m ( 1bi200 1 \le b_i \le 200 ) — the elements of B B .

It can be shown that the answer always exists.

输出格式

Output two numbers a a and b b such that a a belongs to A A , b b belongs to B B , but a+b a+b doesn't belong to nor A A neither B B .

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 20 20 from array [20] [20] and 20 20 from array [10,20] [10, 20] . Number 40=20+20 40 = 20 + 20 doesn't belong to any of those arrays. However, it is possible to choose 10 10 from the second array too.

In the second example, we can choose 3 3 from array [3,2,2] [3, 2, 2] and 1 1 from array [1,5,7,7,9] [1, 5, 7, 7, 9] . Number 4=3+1 4 = 3 + 1 doesn't belong to any of those arrays.

In the third example, we can choose 1 1 from array [1,3,5,7] [1, 3, 5, 7] and 1 1 from array [7,5,3,1] [7, 5, 3, 1] . Number 2=1+1 2 = 1 + 1 doesn't belong to any of those arrays.