#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int n, m;
  cin >> n >> m;
  int k = max(n, m);
  cout << k - 1 << " " << n + m - k;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) {
    Solve();
    cout << '\n';
  }
  return 0;
}
