#include <bits/stdc++.h>
int main() {
  int a, b;
  scanf("%d  %d", &a, &b);
  int diff, same, total;
  total = a + b;
  if (a > b) {
    diff = b;
  } else {
    diff = a;
  }
  same = (total - (2 * diff)) / 2;
  printf("%d  %d\n", diff, same);
  return 0;
}
