#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  int cnt = 0;
  cin >> x >> y;
  if (x != y)
    cout << min(x, y) << " ";
  else
    cout << x << " ";
  if (x > y) {
    x = x - y;
    for (int i = 2; i <= x; i += 2) {
      cnt++;
    }
    cout << cnt;
  } else if (y > x) {
    y = y - x;
    for (int i = 2; i <= y; i += 2) {
      cnt++;
    }
    cout << cnt;
  } else
    cout << 0;
  return 0;
}
