#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for(int i = 1; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i > 0; --i);
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define RREP(i, a, b) for(int i = (int)(b) - 1; i >= (int)(a); --i)

template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } else return false; }
template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } else return false; }

using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m);
    set<int> sa, sb;
    rep(i, n) {
        cin >> a[i];
        sa.insert(a[i]);
    }
    rep(i, m) {
        cin >> b[i];
        sb.insert(b[i]);
    }
    vector<int> ans;
    rep(i, n) {
        if (sb.count(a[i]) == 0) ans.push_back(a[i]);
    }
    rep(i, m) {
        if (sa.count(b[i]) == 0) ans.push_back(b[i]);
    }
    sort(ans.begin(), ans.end());
    for (int i : ans) cout << i << " ";
    cout << endl;
}
#include <iostream>
#include <vector>
#include <utility>
#include<algorithm>
#include <string>
#include <map>
#include <cmath>
#include <random>
#include <tuple>
#include <set>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;


int main(){
  ll n;
  ll m;
  cin >> n;
  cin >> m;
  vector<ll> a(n);
  vector<ll> b(m);
  map<ll,int> c;
  rep(i,n){
    cin >> a[i];
    c[a[i]] ++;
  }
  rep(i,m){
    cin >> b[i];
    c[b[i]]++;
  }
  
  for(auto x:c){
    ll p = x.first;
    ll q = x.second;
    if(q == 1){
      cout << p << ' ';
    }
  }
  cout << endl;
  
  
  return 0;
}