#include <bits/stdc++.h>
using namespace std;
int a,n,sets1[10019],sets2[10019];
int main (){
    scanf("%d %d",&n,&a);
    long long provera=3*a;
    if(provera>n){
        printf("%d\n",-1);
        return 0;
    }
    sets1[1]=a;
    sets1[2]=a;
    sets1[3]=a;
    n-=3*a;
    if(n>=a-2){
        sets2[1]=a-2;
        n-=(a-2);
    }else{
        sets2[1]=n;
        sets2[2]=0;
        sets2[3]=0;
        n=0;
    }
    sets1[1]+=n/2;
    sets2[1]+=n/2;
    sets2[2]+=n%2;
    for(int i = 1; i <= 3; i++){
        if(sets1[i]-sets2[i]<2){
            printf("%d\n",-1);
            return 0;
        }
    }
    for(int i = 1; i <= 3; i++){
        printf("%d %d\n",sets1[i],sets2[i]);
    }
return 0;
}