#include <bits/stdc++.h>
using namespace std;

int main(void){
    // Your code here!
    long long a,b,x,y;
    cin >> a >> b;
    //y=a-b/2
    //x=a/2+b/2
    x = (a+b)/2;
    y = (a-b)/2;
    
    cout << x << " " << y << endl;
}

#include "bits/stdc++.h"
using namespace std;

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;
			}
		}
	}
}
