// Odbojka.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
#include <algorithm>
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
	int n,a;
	int R1[3];
	int R2[3];

	cin >> n >> a;

	if ( n < 3*a ) 
	{
		cout << -1;
		return 0;
	}
	
	if ( n%2 == 0 )
	{
		R1[0] = a;
		R2[0] = 0;
		n -= a;
	}
	else
	{
		R1[0] = a;
		R2[0] = 1;
		n -= a;
	}
	
	R1[1] = a;
	R2[1] = 0;
	n -= a;

	R1[2] = n/2+1;
	R2[2] = n/2-1;

	for ( int i = 0; i < 3; i++ )
	{
		cout << R1[i] << " " << R2[i] << endl;
	}

	return 0;
}