#include <bits/stdc++.h>
using namespace std;
void solve(int t) {
  int n, m;
  cin >> n >> m;
  int p = min(n, m);
  cout << p << " ";
  n -= p;
  m -= p;
  cout << max(0, (max(n, m)) / 2) << endl;
}
int main() {
  int t = 1;
  while (t--) solve(t);
}
