#include <iostream>

using namespace std;

int main()
{
    int n,a;
    cin>>n;
    cin>>a;
    if(n<3*a)
        cout<<-1;
    else
    {
        int x,y;
        for(int i=1; i<=2; i++)
        {
            x=n/3;
            y=0;
            cout<<x<<" "<<y<<endl;
        }
        x=n/3;
        y=n%9;
        if(x-y<2)
        {
            x++;
            y--;
        }
        cout<<x<<" "<<y;
    }
    return 0;
}