#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET) for(int i = 0; i < n; ++i) cout << UIET[i] << " "
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF = (1LL<<60)-1;
const int maxN = 1000001;
int countFreq(string &pat, string &txt)
{
    int M = len(pat);
    int N = len(txt);
    int res = 0;
    for (int i = 0; i <= N - M; i++){ 
        int j;
        for (j = 0; j < M; j++)
            if (txt[i+j] != pat[j])
                break;
        if (j == M)  
        {
           res++;
           j = 0;
        }
    }
    return res;
}
  
int32_t main(){
    SPEED;
    int a, b;
    cin >> a >> b;
    cout << (a + b)/2 << " " << a - (a + b)/2 ;
}
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

template<typename T>
long long modpow(const T n,const T p,const T mod);
template<typename T>
long long modinv(const T n,const T mod);
template<typename T>
bool chmax(T &a,const T &b);
template<typename T>
bool chmin(T &a,const T &b);

long long inf=1000000007;

int main(){
    int a,b;
  cin>>a>>b;
  for(int i=-1000;i<=1000;i++){
    for(int j=-1000;j<=1000;j++){
    if(i+j==a && i-j==b){
      cout<<i<<" "<<j<<endl;
      return 0;
      }
  }
  }
    
    return 0;
}

template<typename T>
long long modpow(const T n,const T p,const T mod){
    if(p==0) return 1;
    if(p%2==0){
        long long a=modpow(n,p/2,mod);
        return a*a%mod;
    }
    if(p%2==1) return (modpow(n,p-1,mod)*n)%mod;
    cerr<<"ERROR"<<endl;
    return 1;
}

template<typename T>
long long modinv(const T n,const T mod){
    return modpow(n,mod-2,mod);
}

template<typename T>
bool chmax(T &a,const T &b){
    if(a<b){
        a=b;
        return 1;
    }
    return 0;
}

template<typename T>
bool chmin(T &a,const T &b){
    if(a>b){
        a=b;
        return 1;
    }
    return 0;
}



