#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;


int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(N);
    vector<int> B(M);
    rep(n, N) {
        cin >> A[n];
    }
    rep(m, M) {
        cin >> B[m];
    }
    vector<int> C;
    set_symmetric_difference(A.begin(), A.end(), B.begin(), B.end(), back_inserter(C));
    for(int c: C) {
        cout << c << " ";
    }
    cout << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define KP                            \
	ios_base::sync_with_stdio(false); \
	cin.tie(NULL);
#define ll long long int
#define rep(i, a, b) for (ll i = a; i < b; i++)
#define MIN -1e9
#define MAX 1e9
#define endl "\n"
#define vi vector<ll>
#define pb push_back
#define all(v) v.begin(), v.end()
#define output(x) cout << (x ? "YES" : "NO") << endl;
bool sortbysecdesc(const pair<ll, ll> &a, const pair<ll, ll> &b)
{
	return a.second > b.second;
}

void solve()
{
	ll n, x;

	cin >> n >> x;

	map<ll, ll>m;

	rep(i, 0, n)
	{
		ll t;

		cin >> t;
		m[t]++;
	}

	rep(i, 0, x)
	{
		ll t;
		cin >> t;
		m[t]++;
	}

	for (auto i = m.begin(); i != m.end(); i++)
	{
		if (i->second == 1)
		{
			cout << i->first << " ";
		}
	}
}

int main()
{
	KP;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll tt = 1;
	// cin >> tt;
	while (tt--)
		solve();

	// cout << "\n\n"
	//      << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " seconds.\n";

	return 0;
}