#include <bits/stdc++.h>
using namespace std;
int ctoi(char);
#define MAX_N 200001
#define l long
#define ll long long
#define f(a, b) for (ll i = a; i < b; i++)
#define f0(a) for (ll i=0;i<a;i++)
#define input(d) cin >> d;
#define inputs(n,d) for(int i=0;i<n;i++){cin >> d[i];}
#define output(d) cout << d << endl;
#define outputs(n,d) for(int i=0;i<n;i++){cout << d[i] << endl;}

int main(void) {
	//ll n;
	//l n;
	l plus, minus;
	l ans, tmp;
	input(plus);
	input(minus);
	//vector<l> tate(h,0);
	//vector<l> yoko(w,0);
	//vector<l> tate_max(2,0);
	//vector<l> yoko_max(2,0);
	//vector<vector <l> > bakudan(m,vector<l>(2,0));
	//
	tmp = (plus+minus)/2;
	ans = plus - tmp;
	//
	cout << tmp << " " << ans << endl;

	return 0;
}

int ctoi(char c){
	switch(c){
		case '0': return 0;
		case '1': return 1;
		case '2': return 2;
		case '3': return 3;
		case '4': return 4;
		case '5': return 5;
		case '6': return 6;
		case '7': return 7;
		case '8': return 8;
		case '9': return 9;
		default : return -1;
	}
}

#include<bits/stdc++.h>
#define ll long long int
#define ul unsigned long long int
#define mp make_pair
#define endl "\n"
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define lb lower_bound
#define forn(i,n) for(ll i=0 ; i<n ; i++)
#define arr(a,n) for(ll i=0;i<n;i++){ cin>>a[i]; }
#define ub upper_bound
#define pb push_back
#define pi pair<int,int>
#define mod 1000000007
#define vectormax *max_element
#define vectormin *min_element
#define arraysize 1000000
#define setbit _builtin_popcountll
using namespace std;

int main(){
	int a,b;
	cin>>a>>b;
	ll temp=(a+b)/2;
	ll hey=(a-b)/2;
	cout<<temp<<" "<<hey<<endl;
	return 0;
	}
