#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
int n_red, n_blue;
void test_case() {
  cin >> n_red >> n_blue;
  int fashionable = 0, non_fashionable = 0;
  while (n_red && n_blue) {
    --n_red;
    --n_blue;
    ++fashionable;
  }
  if (n_red > 1) non_fashionable = n_red / 2;
  if (n_blue > 1) non_fashionable = n_blue / 2;
  cout << fashionable << " " << non_fashionable << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  test_case();
  return 0;
}
