#include<stdio.h>
#include<stdlib.h>
long N,A,o,b,s;
int main(){
	scanf("%lu%lu",&N,&A);
	s=N/A;
	if(s>5){
		s=5;
		b=N-A*s;
		}
	else b=N-A*s;
	if(s==2||s==1||s==0)printf("-1");
	else{
		for(int i=1;i<=s;i++){
			if(i!=s)o=rand()%(b%(A-1));
			else if(b<A-1)o=b;
				else {
					o=(A+b-2)/2;
					A=o+2;
				}
			if(s>3&&i==3||s>3&&i==5)if(s==4){
					printf("%ld  %ld\n",A,o);
					i++;
					b-=o;
				}
				else{
					printf("%ld  %ld\n",o,A);
					b-=o;
				}
			else{
				printf("%ld  %ld\n",A,o);
				b-=o;
			}
		}			
	}
	return 0;
}