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

using namespace std;

int zak(long n,long a)
{
    if(n>a-2) return a-2;
    if(n<0) return 0; else return n;
}
int main()
{
    long i,n,a,m;

  scanf("%d%d",&n,&a);

  if (n<3*a) {printf("%d",-1); return 0;}
  n=n-3*a;

  if (n<a)
  {
      printf("%d %d\n%d %d\n%d %d",a,zak(n,a),a,zak(n-(a-2),a),a,zak(n-(2*a-4),a)); return 0;
  }

  n=n-a;
  if (n<a)
  {
     printf("%d %d\n%d %d\n%d %d\n%d %d",a,zak(n,a),a,zak(n-(a-2),a),a,zak(n-(2*a-4),a),a,zak(n-(3*a-6),a)); return 0;
  }
  n=n-a;

  if(n<=5*(a-2))
  {
     printf("%d %d\n%d %d\n%d %d\n%d %d\n%d %d",a,zak(n,a),a,zak(n-(a-2),a),a,zak(n-(2*a-4),a),a,zak(n-(3*a-6),a),a,zak(n-(4*a-8),a)); return 0;
  }

  n=n-5*(a-2);

  if(n%2==1){printf("%d",-1); return 0;}

  printf("%d %d\n%d %d\n%d %d\n%d %d\n%d %d",a+n/2,a-2+n/2,a,a-2,a,a-2,a,a-2,a,a-2);
 return 0;
}