#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, a, usl, x;
    vector<int> win(3), lose(3);
    cin>> n>> a;
    if(a==2&&n%2==1){cout<<"-1"; return 0;}
    if(n<3*a){cout<<"-1"; return 0;}
    win[0]=a; win[1]=a; win[2]=a;
    usl=4*a;
    if(a==3&&n==11){lose[0]=1; lose[1]=1;}
    else if(n>=usl)
    { n-=usl; x=n/2;
      win[0]+=1+x;
      lose[0]=a-1+x;
      lose[1]=n-2*x;
    }
    else
    { usl=n/3-a; x=n%3;
      lose[0]=usl+x;
      lose[1]=usl;
      lose[2]=usl;
    }
    cout<< win[0]<< ' '<< lose[0]<< endl;
    cout<< win[1]<< ' '<< lose[1]<< endl;
    cout<< win[2]<< ' '<< lose[2];

    return 0;
}