#include <bits/stdc++.h>
using namespace std;
int red, blue;
int main() {
  scanf("%d%d", &red, &blue);
  printf("%d %d\n", max(red, blue) - 1,
         red + blue - 1 - max(red - 1, blue - 1));
  return 0;
}
