import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long a=sc.nextLong();
		long asd=a*3+(a-2)*3;
		long g=a-2;
		if(n<asd) {
			System.out.println(-1);
			sc.close();
			return;
		}
		else if(n%2==0){
			n-=2*a+2*g;
			long g1=(n-2)/2;
			System.out.println(a+" "+g);
			System.out.println(a+" "+g);
			System.out.println((g1+2)+" "+g1);
		}
		else {
			n-=4*a+2*g;
			System.out.println(a+" "+g);
			System.out.println(a+" "+g);
			System.out.println(n/2+" "+a);
			System.out.println(a+" "+(n/2+1));
		}
		sc.close();
	}
}