#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, b;
  cin >> r >> b;
  vector<char> red(r, 'r');
  vector<char> blue(b, 'b');
  int count = 0, days = 0;
  if (r > b) {
    for (int i = 0; i < b; i++) {
      if (red[i] != blue[i]) {
        count++;
      }
    }
    days = (r - count) / 2;
  } else if (r < b) {
    for (int i = 0; i < r; i++) {
      if (red[i] != blue[i]) {
        count++;
      }
    }
    days = (b - count) / 2;
  } else {
    count = r;
    days = 0;
  }
  cout << count << " " << days;
  return 0;
}
