#include <bits/stdc++.h>
using namespace std;
int in() {
  int a;
  cin >> a;
  return a;
}
int gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
void solve() {
  int r = in(), b = in();
  if (r < b) {
    cout << b - 1 << " " << r << endl;
  } else {
    cout << r - 1 << " " << b << endl;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(nullptr);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
