#include <bits/stdc++.h>
using namespace std;
#define int long long
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
/* start */

signed main(){
   IOS;
   int a, b;
   cin >> a >> b;
   for(int i = -1000; i <= 1000; i++) {
      for(int j = -1000; j <= 1000; j++) {
         if(i + j == a and i - j == b) {
            cout << i << " " << j << "\n";
            return 0;
         }
      }
   }  
}
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
int main() {
    int x, y;
    scanf("%d%d", &x, &y);
    int a = (x+y)/2;
    int b = x-a;
    printf("%d %d\n", a, b);
    return 0;
}