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