#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (n < m)
    cout << m + -1 << " " << n << endl;
  else if (n > m)
    cout << n - 1 << " " << m << endl;
  else if (n == m)
    cout << n - 1 << " " << n << endl;
}
