#include <bits/stdc++.h>
using namespace std;
int main() {
  int red, blue;
  cin >> red;
  cin >> blue;
  int fashionDays = 0;
  int normalDays = 0;
  while (red > 0 && blue > 0) {
    red--;
    blue--;
    fashionDays++;
  }
  while (red > 1 || blue > 1) {
    if (red > 1) {
      red -= 2;
    } else {
      blue -= 2;
    }
    normalDays++;
  }
  cout << fashionDays << " " << normalDays;
  return 0;
}
