// Coder: @SumitRaut
#include <bits/stdc++.h>
#define speedup ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
using namespace std;

#define debug1(x) cout<<#x<<' '<<x<<'\n'
#define debug2(x,y) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<'\n'
#define debug3(x,y,z) cout<<#x<<' '<<x<<' '<<#y<<' '<<y<<' '<<#z<<' '<<z<<'\n'
#define ll long long

#ifndef ONLINE_JUDGE
class Timer { chrono::high_resolution_clock::time_point start_t, end_t; public: Timer() { start_t=chrono::high_resolution_clock::now(); } ~Timer() { end_t = chrono::high_resolution_clock::now(); auto duration = chrono::duration_cast<chrono::milliseconds>(end_t-start_t); cerr<<"\nRunTime: "<<duration.count()<<"ms"<<'\n'; } };
#endif
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
    for(auto& it:v)
        is>>it;
    return is;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    for (auto &it : v)
        os << it << ' ';
    return os;
}

void solve() {
    int a,b;
    cin>>a>>b;
    cout<<((a+b)>>1)<<' '<<((a-b)>>1)<<endl;
}
int main()
{
    #ifndef ONLINE_JUDGE
    Timer timer;
    #endif
    speedup;
    // int t; cin>>t; while(t--)
    solve();
    // system("pause");
    return 0;
}

#include <bits/stdc++.h>
#include <cmath>
#define ll long long 
#define m 1000000007

using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	int x,y;
	x = (a+b)/2;
	y = a-x;
	cout<<x<<" "<<y;
}