#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N];
vector<int> vi;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, ans1 = 0, ans2 = 0;
  cin >> n >> m;
  for (;;) {
    if (n >= 1 && m >= 1) {
      n--;
      m--;
      ans1++;
    } else if (n >= 2 && m == 0) {
      n -= 2;
      ans2++;
    } else if (m >= 2 && n == 0) {
      m -= 2;
      ans2++;
    } else if (m == 1 && n == 0 || n == 1 && m == 0 || n == 0 && m == 0)
      break;
  }
  cout << ans1 << " " << ans2;
}
