#include <iostream>
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
    long long int A;
    long long int N;
    scanf("%lld %lld", &N, &A);
    if (N<3*A) printf("-1");
    else if((N-3*A)<=(3*A-6)) {
        if ((N-3*A)>=2*A-4) {
        printf("%lld %lld\n",A,A-2);
        printf("%lld %lld\n",A,A-2);
        printf("%lld %lld\n",A,N-5*A-4);
        }
        else if ((N-3*A)>=(A-2)) {
            printf("%lld %lld\n",A,A-2);
            printf("%lld %lld\n",A,N-4*A-2);
            printf("%lld %d\n",A,0);
        }
        else {
            printf("%lld %lld\n",A,N-3*A);
            printf("%lld %d\n",A,0);
            printf("%lld %d\n",A,0);
        }
    }
    else if ((N-2*A)%2==0) {
        printf("%lld %lld\n",(N-2*A+2)/2,(N-2*A-2)/2);
        printf("%lld %d\n",A,0);
        printf("%lld %d\n",A,0);
    }
    else {
        printf("%lld %lld\n",(N-1-2*A+2)/2,(N-1-2*A-2)/2);
        printf("%lld %d\n",A,1);
        printf("%lld %d\n",A,0);
    }
}