#include <bits/stdc++.h>
using namespace std;

#define long int64_t
#define endl '\n'

#ifdef OFFLINE
	#define logan(...) logg(#__VA_ARGS__, __VA_ARGS__)
	template<class Arg>
	void logg(const char* name, Arg&& arg){ cerr << name << ": " << arg << '\n'; }
	template<class Arg, class ... Args>
	void logg(const char* name, Arg&& arg, Args&& ... args){
		char *next = (char*)name, *cand;
		int depth = 0;
		do{
			if(depth){ next = strchr(next+1, ')'); --depth; }
			else if((cand = strchr(next+1, '('))){ next = cand; ++depth; }
			else{ next = strchr(next+1, ','); }
		}while(depth);
		cerr.write(name, next-name) << ": " << arg << ",";
		logg(next+1, args...);
	}
	#define timeme 1.0*clock()/CLOCKS_PER_SEC
#else
	#define logan(...) {}
	#define timeme {}
#endif

int n, a;

void wina(int k){
	for(int i = 0; i < k; ++i){
		cout << a << ' ' << a-2 << endl;
	}
}

void winb(int k){
	for(int i = 0; i < k; ++i){
		cout << a-2 << ' ' << a << endl;
	}
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cerr.tie(nullptr);
	
	cin >> n >> a;

	int k = 2*a - 2;
	if(n < 3*a){
		cout << -1 << endl;
		return 0;
	}

	if(n >= 4*k+a){
		n -= 4*k;
		n -= a;

		if(n <= a-2){
			wina(2); winb(2);
			cout << a << ' ' << n << endl;
		}else if((n-a+2)%2){
			n -= a-2;
			wina(2); winb(1);
			cout << a-3 << ' ' << a << endl;
			++n;
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}else{
			n -= a-2;
			wina(2); winb(2);
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}
	}else if(n >= 3*k+a){
		n -= 3*k;
		n -= a;

		if(n <= a-2){
			wina(2); winb(1);
			cout << a << ' ' << n << endl;
		}else if((n-a+2)%2){
			n -= a-2;
			wina(2);
			cout << a-3 << ' ' << a << endl;
			++n;
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}else{
			n -= a-2;
			wina(2); winb(1);
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}
	}else if(n >= 2*k+a){
		n -= 2*k;
		n -= a;

		if(n <= a-2){
			wina(2);
			cout << a << ' ' << n << endl;
		}else if((n-a+2)%2){
			n -= a-2;
			wina(1);
			cout << a << ' ' << a-3 << endl;
			++n;
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}else{
			n -= a-2;
			wina(2);
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}
	}else if(n >= k+2*a){
		n -= k;
		n -= 2*a;

		logan(n);
		if(n <= a-2){
			wina(1);
			cout << a << ' ' << 0 << endl;
			cout << a << ' ' << n << endl;
		}else if((n-a+2)%2){
			n -= a-2;
			wina(1);
			cout << a << ' ' << 1 << endl;
			--n;
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}else{
			n -= a-2;
			wina(1);
			cout << a << ' ' << 0 << endl;
			cout << a+n/2 << ' ' << a-2+n/2 << endl;
		}
	}else{
		n -= 3*a;
		cout << a << ' ' << 0 << endl;
		cout << a << ' ' << 0 << endl;
		cout << a << ' ' << n << endl;





	}


}