#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
constexpr char nl = '\n';

signed main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

    const ll mod = 1e9 + 7;
    int n, m;
    cin >> n >> m;
    ll cnt = m;
    cout << m - (n - 1) << ' ' << 1;
}
