#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1015;
const int M = 1e6 + 10;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
void solve() {
  int n, m;
  cin >> n >> m;
  if (n < m) swap(n, m);
  cout << n - 1 << ' ' << m << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  solve();
  return 0;
}
