#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
const vector<int> dy={-1,0,1,0},dx={0,-1,0,1};
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T>void debag(const vector<T> &a){cerr<<"debag :";for(auto v:a)cerr<<v<<" ";cerr<<"\n";}
template<class T>void print(const vector<T> &a){for(auto v:a)cout<<v<<" ";cout<<"\n";}
int main(){
     int n,m;
     cin>>n>>m;
     V<ll> res={},a(n),b(m);
     set<ll> s,t;
     for(int i=0;i<n;i++){
          cin>>a[i];
          s.insert(a[i]);
     }
     for(int i=0;i<m;i++){
          cin>>b[i];
          t.insert(b[i]);
     }
     for(int i=0;i<n;i++){
            if(!t.count(a[i])){
                 res.emplace_back(a[i]);
            }
     }
     for(int i=0;i<m;i++){
            if(!s.count(b[i])){
                 res.emplace_back(b[i]);
            }
     }
     sort(all(res));
     print(res);
}
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int ans[1001];
int n, m;

int main() {
	cin >> n >> m;
	rep(i, n) {
		int a;
		cin >> a;
		ans[a]++;
	}
	rep(i, m) {
		int b;
		cin >> b;
		ans[b]++;
	}
	bool first = false;

	rep(i, 1001) {
		if (!first && ans[i] == 1) {
			cout << i;
			first = true;
		}
		else if (ans[i] == 1) cout << " " << i;
	}

	cout << endl;

	return 0;
}