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


using namespace std;

int main()
{ int a , brp;
scanf("%d%d",&brp,&a);
if(brp<3*a) printf("-1");
else{
brp=brp-2*a;
if(brp<=2*a-2) printf("%d 0\n%d 0\n%d %d",a,a,a,brp-a);
else if(brp%2==1) printf("%d 0\n%d 1\n%d %d",a,a,(brp-1)/2+1,(brp-1)/2-1);
else printf("%d 0\n%d 0\n%d %d",a,a,brp/2+1,brp/2-1);
}


    return 0;
}