#include <bits/stdc++.h>
using namespace std;
int main() {
  int red = 0;
  int blue = 0;
  int cao = 0;
  int bucao = 0;
  cin >> red >> blue;
  for (int i = 0; i < 100; i++) {
    if (red - 1 >= 0 && blue - 1 >= 0) {
      cao++;
      red = red - 1;
      blue = blue - 1;
    } else if (red - 2 >= 0 || blue - 2 >= 0) {
      bucao++;
      red = red - 2;
      blue = blue - 2;
    }
  }
  cout << cao << " " << bucao;
}
