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