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

int main()
{
    int N,A,s1a,s1b = 0,s2a,s2b = 0,s3a,s3b = 0;
    scanf("%d%d", &N, &A);
    if(N < 3 * A){
        printf("-1");
        return 0;
    }
    s1a = s2a = s3a = A;
    N -= 3 * A;
    if(N <= A - 2){
        s1b = N;
    }else{
        s1b = A - 2;
        N -= A - 2;
        s1b += N / 2;
        s1a += N / 2;
        s2b = N % 2;
    }
    printf("%d %d\n", s1a, s1b);
    printf("%d %d\n", s2a, s2b);
    printf("%d %d\n", s3a, s3b);
    return 0;
}