#include "bits/stdc++.h"
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const double PI = 3.141592653589793238;
int main() {
  ll N, M;
  cin >> N >> M;
  set<ll> s;
  for (ll i = 0; i < N; ++i) {
    ll A;
    cin >> A;
    s.insert(A);
  }
  for (ll i = 0; i < M; ++i) {
    ll B;
    cin >> B;
    if (s.find(B) != s.end()) s.erase(B);
    else s.insert(B);
  }
  ll cnt = 0;
  for (auto i = s.begin(); i != s.end(); ++i) {
    ++cnt;
    cout << *i << (cnt == s.size() ? "\n" : " ");
  }
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define yes() cout << "Yes" << endl
#define no() cout << "No" << endl
using ll = long long;
using ld = long double;
using P = pair<int,int>;


int main() {
    int n,m;
    cin>>n>>m;

    vector <int> memo(1001,0);

    rep(i,n+m){
        int x;
        cin>>x;

        memo[x]++;
    }
    rep(i,1001){
        if(memo[i]==1)cout<<i<<" ";
    }
    cout<<endl;
    


}
