#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
#define rep(i,n) for(i=0;i<n;i++)
#define repl(k,n) for(k=0;k<n;++k)

int main() {
	int A, B;
	cin >> A >> B;
	cout << (A + B) / 2<<"\n";
	cout << (A - B) / 2;
	return 0;
}
#include <bits/stdc++.h>

using ll = long long;
using namespace std;
const int INFint = 1e9+1;
const ll INFll = (ll)1e18+1;
ll MOD=1e9+7;


int main(){
  int A,B;
  cin>>A>>B;
  cout << (A+B)/2 << " " << A - (A+B)/2 << endl;
  return 0;
}

