#include <iostream>
#include <stdio.h>
using namespace std;

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