#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, g;
  cin >> r >> g;
  if (r == g) {
    cout << (r + g) / 2 - 1 << " " << (r + g) / 2 << endl;
  } else {
    int mn = min(r, g);
    if (mn == r) {
      cout << g - 1 << " " << r << endl;
    } else {
      cout << r - 1 << " " << g << endl;
    }
  }
  return 0;
}
