#include <bits/stdc++.h>

using namespace std;

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