#include <bits/stdc++.h>
#define min3(a, b, c) min(a, min(b, c))
#define max3(a, b, c) max(a, max(b, c))
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a, b;
    cin >> a >> b;
    cout << (a + b) / 2 << " " << (a - b) / 2 << endl;
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a,b;
    // 3 1 
    cin>>a>>b;
    int i,j;
    for (i=-100;i<=100;i++){
        for( j=-100;j<=100;j++){
            if(i+j == a && i-j==b){
                cout<<i<<" "<<j<<endl;
                return 0;
            }
        }
    }
    return 0;
}