#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
using ll = long long int;

int main(){
    int a, b; cin >> a >> b;
    cout << (a+b)/2 << " " << (a-b)/2 << endl;
    return 0;
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    ll N, M;
    cin >> N >> M;

    if ((M > 0 && M >= N - 1) || M < 0) {
        cout << -1 << endl;
        return 0;
    }

    vector<P> ans(N);
    rep(i, N) { ans[i] = make_pair(3 * (i + 1), 3 * (i + 1) + 1); }

    if (M > 0) ans[N - 1].first = 3 * ((N - 1) - (M + 1) + 1) - 1;

    rep(i, N) { cout << ans[i].first << " " << ans[i].second << endl; }
}