#include <iostream>
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, m;
	vector<int> t(1001, 0);
	cin >> n >> m;
	for(int i=0; i<n; i++){
		int tmp;
		cin >> tmp;
		t[tmp]++;
	}
	for(int i=0; i<m; i++){
		int tmp;
		cin >> tmp;
		t[tmp]++;
	}

	for(int i=1; i<1001; i++){
		if(t[i] == 1){
			cout << i;
			if(i == 1000){
				cout << endl;
			}else{
				cout << " ";
			}
		}
	}

	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>

template<typename Container>
Container SetAnd(const Container &a, const Container &b){
  Container res;
  std::set_intersection(
    std::begin(a), std::end(a),
    std::begin(b), std::end(b),
    std::inserter(res, std::end(res))
  );
  return res;
}
template<typename Container>
Container SetOr(const Container &a, const Container &b){
  Container res;
  std::set_union(
    std::begin(a), std::end(a),
    std::begin(b), std::end(b),
    std::inserter(res, std::end(res))
  );
  return res;
}
template<typename Container>
Container SetXor(const Container &a, const Container &b){
  Container res;
  std::set_symmetric_difference(
    std::begin(a), std::end(a),
    std::begin(b), std::end(b),
    std::inserter(res, std::end(res))
  );
  return res;
}
template<typename Container>
Container SetDiff(const Container &a, const Container &b){
  Container res;
  std::set_difference(
    std::begin(a), std::end(a),
    std::begin(b), std::end(b),
    std::inserter(res, std::end(res))
  );
  return res;
}

int main() {
  int n, m; std::cin >> n >> m;
  std::vector<int> a(n), b(m);
  for(auto &x : a) std::cin >> x;
  for(auto &x : b) std::cin >> x;
  auto c = SetXor(a,b);
  for(auto &x : c) std::cout << x << '\n';
}