#include <bits/stdc++.h>
using namespace std;
int main() {
  int minim;
  int sisa = 0;
  int sum = 0;
  int n, o;
  scanf("%d%d", &n, &o);
  sum = n + o;
  minim = min(n, o);
  sisa = sum - (minim * 2);
  printf("%d %d", minim, sisa / 2);
}
