#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll MOD = 1e9+7;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n,a;
    cin>>n>>a;

    if(3LL*a>n){
        cout<<-1;
        return 0;
    }

    if(n<=6LL*(a-1LL)){
        ll rest=n-3LL*a;
        for(int i=1;i<=3;i++){
            cout<<a<<" ";
            if(rest<=a-2){
                cout<<rest<<endl;
                rest=0;
            }else{
                cout<<a-2<<endl;
                rest-=a-2;
            }
        }
        return 0;
    }else{
        if(n%2==0){
            ll k=(n-6LL*a+6)/2LL;
            cout<<a+k<<" "<<a+k-2LL<<endl;
            cout<<a<<" "<<a-2LL<<endl;
            cout<<a<<" "<<a-2LL<<endl;
        }else{
            if(a<3){
                cout<<-1;
            }else{
                ll k=(n-6LL*a+7)/2LL;
                cout<<a+k<<" "<<a+k-2LL<<endl;
                cout<<a<<" "<<a-2LL<<endl;
                cout<<a<<" "<<a-3LL<<endl;
            }
        }
    }

    return 0;
}