import java.util.Scanner;


public class Odbojka {

  
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int a = sc.nextInt();
        
        if (n%2 ==0&& n> a*3) {
            System.out.println(a + " " + 0);
            System.out.println(a + " " + 0);
            System.out.println(((n-2*a)/2+1) + " " + ((n-2*a)/2-1));
        }
        else if (n%2 != 0 && n > a * 3 ) {
            System.out.println(a + " " + 1);
            System.out.println(a + " " + 0);
            System.out.println(((n-2*a)/2+1) + " " + ((n-2*a)/2-1));
        }
        else {System.out.println(-1);}
        
    }
    
}