#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int a, b;
  cin >> a >> b;
  int res = 0;
  while (true) {
    if (a >= 1 && b >= 1) {
      res++;
      a--;
      b--;
    } else
      break;
  }
  cout << res << " " << a / 2 + b / 2;
}
