#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

int main() {
	int N;
	cin >> N;
	vector<lint>A(N);
	rep(i, N) {
		cin >> A[i];
	}
	int M;
	cin >> M;
	vector<lint>B(M);
	rep(i, M) {
		cin >> B[i];
	}
	vector<lint>C;
	rep(i, N) {
		C.push_back(A[i]);
	}
	rep(i, M) {
		C.push_back(B[i]);
	}
	sort(C);
	C.push_back(-1);
	reverse(C);
	C.push_back(-1);
	reverse(C);
	for (int i = 1; i < C.size() - 1; i++) {
		if (C[i - 1] != C[i] && C[i] != C[i + 1]) {
			cout << C[i] << endl;
		}
	}
}


