#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int ans1 = 0, ans2 = 0;
  while (a > 0 && b > 0) {
    a--;
    b--;
    ans1++;
  }
  int u = max(a, b);
  while (u > 1) {
    u -= 2;
    ans2++;
  }
  cout << ans1 << " " << ans2;
}
