#include <bits/stdc++.h>
int main(void) {
  int a, b, c, d, min, max;
  scanf("%d%d", &a, &b);
  max = a > b ? a : b;
  min = a < b ? a : b;
  c = min / 2;
  d = max - min;
  if (min % 2 != 0) {
    printf("%d %d\n", c * 2 + d, min);
  } else {
    printf("%d %d\n", 2 * c - 1 + d, min);
  }
  return 0;
}
