#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;

int main() {
    int n,m;
    cin >> n >> m;
    set<int> sa, sb;
    rep(i,n){
        int ai ;
        cin >> ai;
        sa.insert(ai);
    }
    rep(i,m){
        int bi ;
        cin >> bi;
        sb.insert(bi);
    }
    vector <int> v(1001,0);
    for(int a : sa) if(sb.count(a)==0) v[a] = 1;
    for(int b : sb) if(sa.count(b)==0) v[b] = 1;
    rep(i,1001) if(v[i] == 1) cout << i << ' ';
}
#include <iostream>
using namespace std;
int main() {
	int a, b;
  cin >> a >> b;
  cout << (a+b) / 2 << ' ' << (a-b) / 2 << endl;
  return 0;
}