#include <bits/stdc++.h>
#define pb push_back
#define endl "\n"
// #define int long long
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;


void solve(){
    int n;
    cin >> n;
    int m;
    cin >> m;
    cout << m - (n - 2) << " " << -1 << endl;
}



signed main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--){
        solve();
    }
}