#include <bits/stdc++.h>
using namespace std;
pair<int, int> func(int r, int b, int c) {
  vector<int> vec;
  pair<int, int> pr;
  int red, blue, p = 2;
  red = r;
  blue = b;
  if (c == 1) {
    red--;
    vec.push_back(1);
  } else {
    blue--;
    vec.push_back(2);
  }
  for (int i = 1; i < r + b; i++) {
    if (p == 2) {
      if (vec[i - 1] == 1) {
        if (blue > 0) {
          vec.push_back(2);
          blue--;
        } else {
          vec.push_back(1);
          red--;
        }
      } else {
        if (red > 0) {
          vec.push_back(1);
          red--;
        } else {
          vec.push_back(2);
          blue--;
        }
      }
      p = 1;
    } else {
      if (vec[i - 1] == 1) {
        if (red > 0) {
          vec.push_back(1);
          red--;
        } else {
          vec.push_back(2);
          blue--;
        }
      } else {
        if (blue > 0) {
          vec.push_back(2);
          blue--;
        } else {
          vec.push_back(1);
          red--;
        }
      }
      p = 2;
    }
  }
  int score = 0;
  for (int i = 0; i + 1 < vec.size(); i++) {
    if (vec[i] == vec[i + 1]) score++;
  }
  pr.first = score;
  score = 0;
  for (int i = 0; i + 1 < vec.size(); i++) {
    if (vec[i] != vec[i + 1]) score++;
  }
  pr.second = score;
  return pr;
}
int main() {
  int r, b;
  cin >> r >> b;
  pair<int, int> pr = func(r, b, 1);
  pair<int, int> qr = func(r, b, 2);
  if (pr.first > qr.first) {
    cout << pr.first << " " << pr.second << endl;
  } else {
    cout << qr.first << " " << qr.second << endl;
  }
}
