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