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