import java.util.Scanner;

public class Odbojka {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int A = scan.nextInt();
		int[] niz = new int[6];

		if (N / 3 < A) {
			System.out.println(-1);
		} else {
			niz[0] = A;
			niz[2] = A;
			niz[4] = A;
			if (N - 3 * A < A * 2 - 4) {
				niz[1] = (int) (N - 3 * A) / 2;
				niz[3] = N - 3 * A - niz[1];

			} else {
				if (N % 2 == 1) {
					niz[5] = 1;
					niz[1] = A - 2;
					niz[0] = niz[0] + (int) (N - 3 * A - A + 2 - 1) / 2;
					niz[1] = niz[1] + (int) (N - 3 * A - A + 2 - 1) / 2;
				} else {
					niz[1] = A - 2;
					niz[0] = niz[0] + (int) (N - 3 * A - A + 2) / 2;
					niz[1] = niz[1] + (int) (N - 3 * A - A + 2) / 2;
				}
			}
			System.out.println(niz[0] + " " + niz[1]);
			System.out.println(niz[2] + " " + niz[3]);
			System.out.println(niz[4] + " " + niz[5]);
		}
	}
}