#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long int n, a;
    scanf("%lld %lld", &n, &a);

    long long int r1, r2, r3, r4, r5, r6;
    r1 = a;
    r2 = 0;
    r3 = a;
    r4 = 0;

    if(n - 3*a < 0)
    {
        printf("-1");
        return 0;
    }

    long long int n1 = n - 2*a;


    if(n1 % 2 == 0)
    {
        r5 = n1 / 2 + 1;
        r6 = n1 / 2 - 1;
    }
    else
    {
        r5 = n1 / 2 + 1;
        r6 = n1 / 2 - 1;
        r4 = 1;
    }

    printf("%lld %lld \n", r1, r2);
    printf("%lld %lld \n", r3, r4);
    printf("%lld %lld \n", r5, r6);





    return 0;
}