#include <iostream>
using namespace std;

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv) {
	int n,a;
	cin >> n >> a;
	int d = n / a;
	if(d < 3){
	 cout << -1<< endl;
	 
}
	else{
		int o = n % a;
		if (o == 0){
			if(d==3){
				cout <<a<<" 0"<<endl;
				cout <<a<<" 0"<<endl;
				cout <<a<<" 0"<<endl;
				return 0;
			}
				if(d==4){
				cout <<a<<" 0"<<endl;
				cout <<"0 "<<a<<endl;
				cout <<a<<" 0"<<endl;
				cout <<a<<" 0"<<endl;
				return 0;
			}
				if(d==5){
				cout <<a<<" 0"<<endl;
				cout <<a<<" 0"<<endl;
				cout <<"0 "<<a<<endl;
				cout <<"0 "<<a<<endl;
				cout <<a<<" 0"<<endl;
				return 0;
			}
	
			}
		}
	
	return 0;
}