#include <iostream>

using namespace std;

int main()
{
    long long n,a;
    scanf("%lld%lld",&n,&a);
    if (n<3*a)
    {
        printf("-1");
    }
    else
    if (n>=3*a && n<=6*a-6)
    {
        n=n-3*a;
        for (long long i=0;i<3;i++)
        {
            printf("%lld ",a);
            if (n>=a-2)
            {
                printf("%lld\n",a-2);
                n=n-a+2;
            }
            else
            {
                printf("%lld\n",n);
                n=0;
            }
        }
    }
    else
    {
        if (n%2==0)
        {
            printf("%lld 0\n",a);
            printf("%lld 0\n",a);
            long long k=n/2-2*a;
            printf("%lld %lld",a+k+1,a+k-1);
        }
        else
        {
            if (a==2) printf("-1"); else
            {
                printf("%lld 0\n",a);
                printf("%lld 1\n",a);
                long long k=(n-1)/2-2*a;
                printf("%lld %lld",a+k+1,a+k-1);
            }
        }
    }
    return 0;
}