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