import java.util.*;
import java.lang.*;

public class Zadatak {

    public static void main(String[] args){
       int A, N, a, b, c, d, e, f, g, i, j, k;
        Scanner skener = new Scanner(System.in);
        N = skener.nextInt();
        A = skener.nextInt();
        if ((N % 6) % 2 == 0) {
            a = (N / 6) + 1;
            b = (N / 6) - 1;
            c = (N / 6) + 1;
            d = (N / 6) - 1;
            e = (N / 6) + 1 + ((N % 8) / 2);
            f = (N / 6) - 1 - ((N % 8) / 2);

            if (a < A || c < A || e < A) {
                System.out.println(-1);
            } else {
                System.out.printf("%d,%d\n", a, b);
                System.out.printf("%d,%d\n", c, d);
                System.out.printf("%d,%d\n", e, f);

            }
        }
        else if ((N%6)%2==1){
            a = (N / 6) + 1;
            b = (N / 6) - 1;
            c = (N / 6) + 1;
            d = (N / 6) - 1;
            e = (N / 6) + 1 + ((N % 8) / 2);
            f = (N / 6)  - ((N % 8) / 2);

            if (a < A || c < A || e < A) {
                System.out.println(-1);
            } else {
                System.out.printf("%d,%d\n", a, b);
                System.out.printf("%d,%d\n", c, d);
                System.out.printf("%d,%d\n", e, f);

            }
        }
    }
}