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