#include <bits/stdc++.h>
using namespace std;
int main() {
  int red = 0;
  int blue = 0;
  int sum = 0;
  int number = 0;
  cin >> red;
  cin >> blue;
  while (red > 0 && blue > 0) {
    sum = sum + 1;
    red = red - 1;
    blue = blue - 1;
  }
  while (red > 1) {
    red = red - 2;
    number = number + 1;
  }
  while (blue > 1) {
    blue = blue - 2;
    number = number + 1;
  }
  cout << sum << " ";
  cout << number << endl;
}
