#include <bits/stdc++.h>
using namespace std;
char moves[200000];
void fillmoves(int n, int m) {
  int sn, sm;
  sn = n;
  sm = m;
  for (int i = 1; i < sn + sm + 1; i++) {
    if (i % 2 != 0) {
      if (moves[i - 1] == 'R') {
        if (m > 0) {
          moves[i] = 'B';
          m--;
        } else {
          moves[i] = 'R';
          n--;
        }
      } else {
        if (n > 0) {
          moves[i] = 'R';
          n--;
        } else {
          moves[i] = 'B';
          m--;
        }
      }
    } else {
      if (moves[i - 1] == 'R') {
        if (n > 0) {
          moves[i] = 'R';
          n--;
        } else {
          moves[i] = 'B';
          m--;
        }
      } else {
        if (m > 0) {
          moves[i] = 'B';
          m--;
        } else {
          moves[i] = 'R';
          n--;
        }
      }
    }
  }
}
pair<int, int> count(int n, int m) {
  int pp = 0, vp = 0;
  for (int i = 1; i < n + m; i++) {
    if (moves[i - 1] == moves[i]) pp++;
  }
  for (int i = 1; i < n + m; i++) {
    if (moves[i - 1] != moves[i]) vp++;
  }
  return pair<int, int>(pp, vp);
}
int main() {
  int n, m;
  cin >> n >> m;
  moves[0] = 'R';
  fillmoves(n - 1, m);
  pair<int, int> resA = count(n, m);
  moves[0] = 'B';
  fillmoves(n, m - 1);
  pair<int, int> resB = count(n, m);
  if (resA.first > resB.first)
    cout << resA.first << " " << resA.second << endl;
  else
    cout << resB.first << " " << resB.second << endl;
  return 0;
}
