#include <bits/stdc++.h>
using namespace std;
void solve() {
  int r, b;
  cin >> r >> b;
  if (r == b) {
    cout << r - 1 << " " << r << "\n";
    return;
  }
  int maxPosss = r + b - 1;
  cout << maxPosss - min(r, b) << " " << min(r, b) << "\n";
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
