#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5, MOD = 1e9 + 7;
int n, m;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  if (n < m) swap(n, m);
  cout << n - 1 << " " << m << endl;
  return 0;
}
