#include <iostream>

int main()
{
	int a, n, niz1[5], niz2[5], br = 0, pom=0;
	std::cin >> n >> a;
	while (pom < n / 2 && br < 5)
	{
		niz1[br] = a;
		pom += a;
		br++;
	}
	if (br >= 3) {
		pom = n - a * br;
		for (int i = 0; i < br; i++)
		{
			if (pom >= (a - 2))
			{
				niz2[i] = a - 2;
				pom -= (a - 2);
			}
			else
				if (pom > 0) {
					niz2[i] = pom;
					pom = 0;
				}
				else
					niz2[i] = 0;
		}
		if (pom != 0) {
			pom += niz1[br - 1] + niz2[br - 1];
			if (pom % 2 == 0)
			{
				niz1[br - 1] = pom / 2 + 2;
				niz2[br - 1] = pom / 2 - 2;
			}
			else
			{
				niz1[br - 1] = 1 + pom / 2;
				niz2[br - 1] = pom / 2 - 1;
			}
		}
		if (br == 4)
			std::swap(niz1[1], niz2[1]);
		if (br == 5)
		{
			std::swap(niz1[1], niz2[1]);
			std::swap(niz1[2], niz2[2]);

		}
		for (int i = 0; i < br; i++)
			std::cout << niz1[i] << " " << niz2[i] << std::endl;
	}
	else
		std::cout << "-1";
	system("pause");

}