#include <bits/stdc++.h>
using namespace std;
void run();
int main() {
  ios::sync_with_stdio(0);
  run();
}
void run() {
  int v[2];
  cin >> v[0] >> v[1];
  int best = 0;
  for (int i = 2; i--;) {
    int w[2] = {v[0], v[1]};
    swap(v[0], v[1]);
    int got = -1;
    for (int j = 0, k = 0, t = 0; w[0] + w[1]; j++, t = !t) {
      if (w[k ^ t])
        got += !t, k ^= t, --w[k];
      else
        --w[k], got += t;
    }
    best = max(best, got);
  }
  cout << best << " " << v[0] + v[1] - best - 1 << endl;
}
