#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo LLONG_MAX
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
/*

*/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  
  ll X, Y;
  cin >> X >> Y;
  for(ll i = -100; i <= 100; i++){
    for(ll j = -100; j <= 100; j++){
      if (i + j == X && i - j == Y){
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}

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