#include<bits/stdc++.h>

using namespace std;

#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define ll long long
#define pb push_back
#define input(a,n) for(ll i=0;i<n;i++){ll y;cin>>y;a.pb(y);}
#define print(x) for(auto it:x)cout<<it<<" ";cout<<"\n";
#define all(x) (x).begin(),(x).end()
#define clr(x) memset(x,0,sizeof(x))
#define fn(a,n) for(ll i = a; i < n; ++i)
#define f(n) for(ll i = 0; i < n; i++)
#define endl '\n'
#define test ll t;cin>>t;while(t--)
#define INF 1000000000
#define MAX 100001
#define pyes cout<<"YES"<<endl;
#define pno cout<<"NO"<<endl;
#define sz(x) (x).size()

const ll mod=1000000007;

int main()
{
    io;
    //test
    {
        int a,b;
        cin>>a>>b;
        int x,y;
        x=(a+b)/2;
        y=(a-b)/2;
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v){
    if(v.empty()){
        os<<"{ }";
        return os;
    }
    os<<"{"<<v.front();
    for(auto itr=++v.begin();itr!=v.end();itr++){
        os<<", "<<*itr;
    }
    os<<"}";
    return os;
}

template<typename T_first,typename T_second>
ostream& operator<<(ostream& os,const pair<T_first,T_second>& P){
    os<<"("<<P.first;
    os<<", "<<P.second;
    os<<")";
    return os;
}

int main(){
    int a,b; cin>>a>>b;
    cout<<(a+b)/2<<" "<<(a-b)/2<<endl;
}