#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, x, y, mi;
  cin >> a >> b;
  mi = min(a, b);
  a -= mi;
  b -= mi;
  cout << mi << " ";
  if (a)
    cout << a / 2;
  else
    cout << b / 2;
  return 0;
}
