#include <bits/stdc++.h>

/*
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
*/
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define rep(i,l,r) for (int i=l;i<=r;i++)
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define nul(x) memset((x),0,sizeof((x)))
#define random_jbt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

using namespace std;

int main(){
    ios;

    ll n,a;
    cin>>n>>a;


    ll sum = 3*a;
    if (sum > n)return cout<<-1,0;

    n -= 3*a;
    pair<ll,ll>d[3];
    d[0]={a,0};
    d[1]={a,0};
    d[2]={a,0};

    d[0].se += min(n,a-2);
    n -= d[0].se;

    d[0].fi += n/2;
    d[0].se += n/2;

    d[1].se += n%2;

    if (d[1].fi - d[1].se == 1)return cout<<-1,0;
    for (int i=0;i<3;i++){
        cout<<d[i].fi<<" "<<d[i].se<<"\n";
    }
    return 0;
}