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

int main()
{
    long long N, A;
    long rez = -1;
    scanf("%lld %lld",&N,&A);
    if(N < A * 3)
    {
        printf("%ld",rez);
        return 0;
    }
    if(A == 2)
    {
        if(N % 2 == 1)
        {
            printf("%ld",rez);
            return 0;
        }
        printf("2 0\n");
        printf("2 0\n");
        long long pomoc = (N - 4) / 2;
        printf("%lld %lld",pomoc + 1, pomoc - 1);
        return 0;
    }

    printf("%lld 0\n",A);
    printf("%lld %lld\n",A, (N - 2 * A) % 2);
    long long nPomoc = N - A * 2;
    nPomoc -= nPomoc % 2;
    if(nPomoc / 2 < A)
    {
        printf("%lld %lld",A , nPomoc - A);
        return 0;
    }
    printf("%lld %lld",nPomoc / 2 + 1, nPomoc / 2 - 1);
    return 0;
}