#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  while (cin >> a >> b) {
    int x = min(a, b);
    int y = (a - x) / 2 + (b - x) / 2;
    cout << x << " " << y << endl;
  }
  return 0;
}
