#include <bits/stdc++.h>
using namespace std;
void files();
int r, b;
int main() {
  scanf("%d%d", &r, &b);
  printf("%d %d", r + b - 1 - min(r, b), min(r, b));
  return 0;
}
void files() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
