#include <iostream>
#include <stdio.h>
#include <algorithm>

using namespace std;

int a, n;
bool tk;
int main()
{
    scanf("%d%d", &n, &a);
    if(n<3*a||n<6){
        cout<<-1;
        return 0;
    }
    if(n%2!=0){
        n=n-1;
        tk=true;
    }
    if(n>=3*a&&n<=4*a-1){
        if(tk){
            printf("%d %d\n", a, 0);
            printf("%d %d\n", a, 1);
        }else{
            printf("%d %d\n", a, 0);
            printf("%d %d\n", a, 0);

        }
        printf("%d %d", a, n-3*a);
        return 0;
    }
    n=n-2*a;
    n=n/2;
    if(tk){
        printf("%d %d\n", a, 0);
        printf("%d %d\n", a, 1);
    }else{
        printf("%d %d\n", a, 0);
        printf("%d %d\n", a, 0);

    }
    printf("%d %d\n", n+1, n-1);


}