#include <iostream>
#include <cstdio>
using namespace std;
int main ()
{
    int n, m, a, b, k;
    scanf("%d%d", &n, &m);
    if (n<m+m+m || (m==2&&n%2==1)) 
    {
        printf("-1\n");
        return 0;
    }  
    else
    {
    k=0;
    int x=n-m-m;
    if (x<=m+m-2)
    {
        a=m;
        b=x-a;
    }
    else 
    {
    	if (x%2==1)
        	{
           	 k=1;
           	 x--;
       		 }
        a=x/2+1;
        b=x/2-1;
    }
}
    printf("%d 0\n%d %d\n %d %d\n", m, m, k, a, b);
    return 0;
}