#include <bits/stdc++.h>
using namespace std;
int r, b, dif, same, red, blue;
int main() {
  cin >> red >> blue;
  if (red >= blue) {
    dif = blue;
    red -= blue;
    if (red % 2 == 0) {
      same = red / 2;
    } else {
      same = (red - 1) / 2;
    }
  } else {
    dif = red;
    blue -= red;
    if (blue % 2 == 0) {
      same = blue / 2;
    } else {
      same = (blue - 1) / 2;
    }
  }
  cout << dif << " ";
  cout << same;
  return 0;
}
