#include <bits/stdc++.h>
using namespace std;
void pravi(long long  N , long long  A)
{
    long long  x1 , x2;
    x1 = A;
    N =N -A;
    if(N < A -1)
    {
        x2 = N;
        N=0;
    }

    else
    {
        x2 = A-1;
        x1++;
        N = N-A;
    }
    if(N > 0)
    {
        x1  = x1 + N/2;
        x2 = x2 + N/2;

    }







    printf("%lld %lld\n", x1,x2);

}
int main()
{
 long long n , A;
scanf("%lld %lld" , &n , &A);
if(A == 1)
    A=2;







if(A*3 > n)
    printf("-1");

else if(A == 2 && n % 2==1)
    printf("-1");


else
{
    if(n == A*3)
    {
        printf("%lld %d\n", A , 0 );
        printf("%lld %d\n", A , 0 );
        printf("%lld %d\n", A , 0 );
    }
    else if((n- 2*A) % 2 == 0   )
        {

            printf("%lld %d\n", A , 0 );
            printf("%lld %d\n", A , 0 );
            pravi(n - 2 *A , A);

        }

    else
        {

             printf("%lld 0\n", A );
            printf("%lld 1\n", A );
            pravi(n-2*A-1 , A );



        }


}
return 0;
}