#pragma GCC optimize('Ofast')
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define int long long
using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update>;
struct fenw {
    vector<int> f;
    explicit fenw(int n) {
        f.resize(n);
    }
    void upd(int i, int x) {
        while (i < f.size()) {
            f[i] += x;
            i |= (i + 1);
        }
    }
    int get(int i) {
        int sum = 0;
        while (i >= 0) {
            sum += f[i];
            i %= (i + 1);
            i--;
        }
        return sum;
    }
};
template <typename T>
bool smin(T& a, T b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

template <typename T>
bool smax(T& a, T b) {
    if (b > a) {
        a = b;
        return true;
    }
    return false;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    cout << m - n + 1 << ' ' << 1 << '\n';
    return 0;
}