#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define si short int
#define vi vector<ll>
#define vii vector<vi>
#define ul unsigned ll

ll x[5]={-1,-1,-1,-1,-1},y[5]={-1,-1,-1,-1,-1};

int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll n,a;
    cin>>n>>a;
    if(3*a>=n) cout<<"-1"<<endl;
    else
    {
        x[0]=a;
        x[1]=a;
        y[0]=0;
        y[1]=0;
        n-=2*a;
        if(n%2==0)
        {
            x[2]=n/2+1;
            y[2]=n/2-1;
        }
    }

    ll i=0;
    while(x[i]!=-1 && y[i]!=-1)
    {
        cout<<x[i]<<' '<<y[i]<<endl;
        i++;
    }
}