#ifdef LOCAL
// #define _GLIBCXX_DEBUG
#define debug(x) cerr << __LINE__ << ": " << (#x) << " = " << (x) << endl
#else
#define debug(...) 42
#endif

#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
// #pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef __int128 LL;
#define all(x) (x).begin(), (x).end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

template<typename T>
istream &operator >>(istream &in, vector<T> &a) {
    for (auto &elem : a) {
        in >> elem;
    }
    return in;
}

template<typename T>
ostream &operator <<(ostream &out, const vector<T> &a) {
    for (const auto &elem : a) {
        out << elem << ' ';
    }
    return out;
}

int n, m;

void solve() {
    cout << m - n - 1 << " 1\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> m;
    solve();
}