#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int m;
  cin >> n;
  cin >> m;
  int ans = min(m, n);
  m = m - ans;
  n = n - ans;
  int ans1 = 0;
  if (m != 0) {
    ans1 = m / 2;
  }
  if (n != 0) {
    int res = n / 2;
    if (res > ans1) {
      ans1 = res;
    }
  }
  cout << ans << " " << ans1;
}
