#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, k = 0, l = 0;
  cin >> a >> b;
  if (a > b) {
    while (b > 0) {
      b--;
      a--;
      k++;
    }
  } else {
    while (a > 0) {
      a--;
      b--;
      k++;
    }
  }
  if (a == 1 && b == 0 || b == 1 && a == 0) {
    cout << k << " " << 0;
    return 0;
  }
  if (a < 1) {
    while (b > 1) {
      b -= 2;
      l++;
    }
  } else {
    while (a > 1) {
      a -= 2;
      l++;
    }
  }
  cout << k << " " << l;
  return 0;
}
