#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream &operator<<(ostream &os, pair<S, T> &m) {
  os << '[' << m.first << " " << m.second << ']';
  return os;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (m < n) swap(n, m);
  cout << m - 1 << ' ' << n << endl;
  return 0;
}
