#include <bits/stdc++.h>
using namespace std;
int main() {
  int ared, bblue, differsocks, samesocks;
  cin >> ared >> bblue;
  if (ared < bblue) {
    differsocks = ared;
    samesocks = (bblue - differsocks) / 2;
  } else {
    differsocks = bblue;
    samesocks = (ared - differsocks) / 2;
  }
  cout << differsocks << "  ";
  cout << samesocks << endl;
  return 0;
}
