#include<ctime>
#include<cstdio>
#include<cctype>
using namespace std;
const int N=1e3+7;
int read() {
	char c;
	int x=0,f=1;
	while(!isdigit(c=getchar()))
		f-=2*(c=='-');
	while (isdigit(c)){
		x=x*10+(c-48)*f;
		c=getchar();
	}
	return x;
}
int n,m,a[N],b[N];
int main() {
	#ifndef ONLINE_JUDGE
	freopen("B.in","r",stdin);
	freopen("B.out","w",stdout);
	#endif
	clock_t t1=clock();
	//--------
	n=read();
	m=read();
	for(int i=1;i<=n;++i)
		a[read()]=1;
	for(int i=1;i<=m;++i)
		b[read()]=1;
	for(int i=1;i<=1000;++i){
		if(a[i]^b[i])
			printf("%d ",i);
	}
	//--------
	clock_t t2=clock();
	fprintf(stderr,"time:%0.3lfs",1.0*(t2-t1)/CLOCKS_PER_SEC);
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
using u64 = uint_least64_t;
using s64 = int_least64_t;
using ll = uint_least64_t;

int main(){
    int n,m;

    cin >> n >> m;
	vector<int> a(n+m),b(m);
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	for (int i = 0; i < m; i++){
		cin >> a[n+i];
	}
	sort(a.begin(), a.end());

	int nn = n + m;
	for (int i = 1; i < nn; i++){
		if (a[i-1] == a[i]){
			a.erase(a.begin()+i-1);
			a.erase(a.begin()+i-1);
			i--;
			nn-=2;
		}
	}
	for (auto i = a.begin(); i != a.end(); i++){
		cout << *i << " ";
	}
	cout << endl;
	return 0;
}