#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;

int main()
{
  int n,a;
  scanf("%d %d",&n,&a);
  if(n<3*a)
  {
      printf("-1");
      return 0;
  }
  int bu = n/a;
  if(bu>5) bu=5;
    int tim1[5],tim2[5];

    switch(bu){
    case 3: tim1[0] = a; tim1[1] = a; tim1[2] = a;break;
    case 4: tim1[0] = a; tim2[1] = a; tim1[2] = a; tim1[3] = a;break;
    case 5: tim1[0] = a; tim2[1] = a; tim1[2] = a; tim2[3] = a; tim1[4]=a;
    }
    int pom=n -bu*a,i;
    for(i=0;i<bu;i++)
    {
        if(tim1[i]==a) if(pom<=(a-2)){tim2[i]=pom;pom=0;}else{tim2[i]=a-2;pom-=a-2;}
        else {if(pom<=(a-2)){tim1[i]=pom;pom=0;}else{tim1[i]=a-2;pom-=a-2;}}
        //printf("%d %d\n",tim1[i],tim2[i]);
    }
    if(pom>0 && pom%2==1){
        printf("-1");
        return 0;
    }
    tim1[0]+=pom/2;
    tim2[0]+=pom/2;
    for(i=0;i<bu;i++)
    {
        printf("%d %d\n",tim1[i],tim2[i]);
    }
}