#include <bits/stdc++.h>
using namespace std;
int main() {
  int red, blue;
  cin >> red >> blue;
  int diffColourDay = min(red, blue);
  int sameColourDay = max(red, blue) - diffColourDay;
  sameColourDay /= 2;
  cout << diffColourDay << " " << sameColourDay << endl;
  return 0;
}
