#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 5;
const int N = 2e7 + 5;
const long long int mod = 1e9 + 7;
bool comp(const int a, const int b) { return a > b; }
const double PI = 2 * acos(0.0);
int main() {
  long long int n, m;
  scanf("%lld %lld", &n, &m);
  long long int b = min(n, m);
  long long int a = n + m - 1 - b;
  cout << a << " " << b;
}
