#include <bits/stdc++.h>
using namespace std;
int lcm[1000005];
int main() {
  int m, n;
  while (scanf("%d%d", &n, &m) != EOF) {
    int mx, mn;
    if (m > n) {
      mx = m;
      mn = n;
    } else {
      mx = n;
      mn = m;
    }
    int ans;
    ans = mx - 1;
    printf("%d %d\n", ans, mn);
  }
  return 0;
}
