#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int petiaPoints = 0;
  int vasiaPoints = 0;
  int min = (n > m) ? m : n;
  int diff = (n > m) ? n - m : m - n;
  petiaPoints = min - 1 + diff;
  vasiaPoints = min;
  cout << petiaPoints << ' ' << vasiaPoints << endl;
  float time = ((float)clock()) / CLOCKS_PER_SEC;
  cerr << "profiling time: " << time << " sec" << endl;
  return 0;
}
