    #include <bits/stdc++.h>
     
    using namespace std;
     
     #define tr(c, i) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
    #define   ipr         	pair<int, int>
    #define   pb            push_back
    #define   ff            first
    #define   ss            second
   // #define fill(a,b) memset(a, b, sizeof(a))
    #define   fr(i, j, k)   for (int i = j; i < k; i++)
    #define   rf(i, j, k)   for (int i = j; i >= k;i--)
    #define   int           long long int
    #define   ll 			unsigned long long
    #define   ld            long double
    #define   all(x)        x.begin(), x.end()
    #define   rall(x)       x.rbegin(),x.rend()
    #define   mp            make_pair
    #define L(x) ('a'<=x && x<='z')
    #define   inf           INT_MAX
    #define   read_file();	freopen("input.txt", "r", stdin);	freopen("output.txt", "w", stdout);
    #define   IOS           std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
     
     
    const ld  pi   =  acos(-1);
    const int mod =  1000000007;
    const double epsilon = 1e-9; 
     
     
    template<class T> ostream& operator <<(ostream &out,vector<T> &A){for(auto x:A) out<<x<<" ";return out;}
    template<class T> ostream& operator <<(ostream &out,set<T> &A){for(auto x:A) out<<x<<" ";return out;}
    template<class T> ostream& operator <<(ostream &out,unordered_set<T> &A){for(auto x:A) out<<x<<" ";return out;}
    template <class T1,class T2>T1 powr(T1 a,T2 b){T1 res = 1;fr(i,1,b+1)res = res*a;return res;}
     
    int binpow(int a,int b) {
        a=a%mod;
       
        int res = 1;
    while (b > 0) {
            if (b & 1)res = (res * a)%mod;
            a = (a * a)%mod;
            b >>= 1;
    }
    return (res+mod)%mod;
    }
    
        const int  N = 10000025 ;
    int prime[N];
    int prime_cnt[N];
     
     
     
     
    void SieveOfEratosthenes() 
    { 
        fr(i,0,N)prime[i]=i;
      
        prime[0]=0;
        prime[1]=1;
     
      
        for (int p=2; p*p<=10000000; p++) 
        { 
            
            if (prime[p] == p) 
            {   
                for (int i=p; i<=10000000; i += p) 
                   if(prime[i]==i) prime[i] = p; 
            } 
        } 
     
    }


  
   
     
  int32_t main(){
        IOS;
      int t;
     // cin>>t;
      t=1;
     
     while(t--){

       int a,b;
       cin>>a>>b;
       cout<<(a+b)/2<<" "<<(a-b)/2<<endl;
      }
   }
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pii pair<int, int>
#define F first
#define S second
#define all(c) ((c).begin()), ((c).end())
#define sz(x) ((int)(x).size())
#define ld long double

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<", "<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"{";
	for(int i = 0;i < (int)v.size(); i++){
		if(i)os<<", ";
		os<<v[i];
	}
	os<<"}";
	return os;
}

#ifdef LOCAL
#define cerr cout
#else
#endif

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
	const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

int main(){
	ios_base::sync_with_stdio(false); 
	cin.tie(NULL);
	int A, B;
	cin >> A >> B;
	cout << (A + B) / 2 << " " << (A - B) / 2 << endl;
}