#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m;
  cin >> n >> m;
  int maxi = max(n, m), mini = min(n, m);
  int petyaPoints = mini - 1 + (maxi - mini);
  int vasyaPints = mini;
  cout << petyaPoints << " " << vasyaPints << endl;
}
