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