#include <bits/stdc++.h>
using namespace std;
void test_case() {
  int n, m;
  cin >> n >> m;
  int pety = min(n, m);
  int vasy = n + m - 1 - pety;
  cout << vasy << " " << pety;
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  int T = 1;
  while (T-- > 0) {
    test_case();
  }
  return 0;
}
