#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  while (scanf("%d%d", &a, &b) != EOF) {
    int s = min(a, b);
    a = a - s;
    b = b - s;
    int s1 = max(a / 2, b / 2);
    printf("%d %d\n", s, s1);
  }
  return 0;
}
