#include <stdio.h>
#include <stdlib.h>


int main()
{
    int A;
    long int N, total=0;
    int arr[10];
    int i,j,tem = 0,tema,x;
    scanf("%d %ld", &N ,&A);
    if(N < 3 * A){
        printf("-1");
        return 0;
    }


    for(i=0;i<6;i+=2){
        if(N == 3*A){
                arr[i]=A;
                arr[i+1]=0;
        }
        else{
        if(i == 4){
            x = N - total;
            if(x%2 == 1){
                arr[1] = 1;
                x-=1;
            }
            arr[i] = x / 2 + 1;
            arr[i+1] = x / 2 - 1;

        }else{
            arr[i] = A;
            arr[i+1] = 0;
            total += A;
        }
    }}

    for(i=0;i<6;i+=2){
        printf("%ld %ld\n",arr[i],arr[i+1]);
    }

    return 0;
}