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