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