#include<iostream>
using namespace std;
int main(){
  int a,b;cin>>a>>b;
  cout<<(a+b)/2<<" "<<a-(a+b)/2;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;

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

    return 0;
}