#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

int main() {
	int a, n;
	cin >> n >> a;
	if (a == 2 && n % 2 == 1) {
		cout << -1;
		return 0;
	}
	if (n < 3 * a) {
		cout << -1;
		return 0;
	}
	int p, q;
	n -= 3 * a;
	p = min(a - 2, n);
	n -= p;
	q = min(a - 2, n);
	n -= q;
	if (n <= a - 2) {
		cout << a << ' ' << p << endl;
		cout << a << ' ' << q << endl;
		cout << a << ' ' << n << endl;
		return 0;
	}
	if ((n + a) % 2 == 1) {
		n++;
		q--;
	}
	int r = (a + n) / 2 + 1;
	cout << a << ' ' << p << endl;
	cout << a << ' ' << q << endl;
	cout << r << ' ' << r - 2 << endl;
	return 0;
}