#include <stdio.h>
using namespace std;
int main(int argc, const char * argv[]) {
    long long a,n;
    scanf("%lld%lld",&n,&a);
    if(n<3*a)
        printf("-1");
    else if(n%2==0)
    {
        if(n>=4*a-2)
            printf("%lld 0\n%lld 0\n%lld %lld",a,a,n/2+1-a,n/2-1-a);
        else
            printf("%lld %lld\n%lld 0\n%lld 0",a,n-3*a,a,a);
    }
    else
    {
        if(n==3*a)
            printf("%lld 0\n%lld 0\n%lld 0",a,a,a);
        else if(n>3*a && n<4*a-1)
            printf("%lld %lld\n%lld 0\n%lld 0",a,n-3*a-1,a,a);
        else
            printf("%lld 0\n%lld 1\n%lld %lld",a,a,n/2-a+1,n/2-a-1);
    }
    
    
    return 0;
}