#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, b;
  cin >> r >> b;
  int mn = min(r, b);
  int mx = max(r, b);
  cout << mn << " ";
  mx -= mn;
  if (mx == 0 || mx == 1) {
    cout << 0;
    return 0;
  }
  if (mx > 1) {
    if (mx == 2) {
      cout << 1;
      return 0;
    } else {
      cout << mx / 2;
    }
  }
  return 0;
}
