#include <bits/stdc++.h>
using namespace std;
const int N = 111111;
const int INF = 1000000000, mod = 1000000007;
const long long LLINF = 1000000000000000000ll;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  int cnt1, cnt2;
  cnt1 = max(n, m) - 1;
  cnt2 = min(n, m);
  printf("%d %d\n", cnt1, cnt2);
  return 0;
}
