#include<stdio.h>

int main(){
   unsigned prvideo=0,drugideo=0,A,N;
   scanf("%u%u",&N,&A);
  if(3*A>N)printf("-1");
  else if (N%2==0){
    printf("%u 0\n",A);
    printf("%u 0\n",A);
    prvideo=(N-2*A)/2+1;
    drugideo=(N-2*A)/2-1;
     printf("%u %u\n",prvideo,drugideo);
  }
  else if(N%2==1){
    printf("%u 0\n",A);
    printf("%u 1\n",A);
    prvideo=(N-2*A-1)/2+1;
    drugideo=(N-2*A-1)/2-1;
     printf("%u %u\n",prvideo,drugideo);
  }
  else printf("0");
  return 0;
}