using System;
class Program
{
    static void Main(string[] args)
    {
        string[] a = Console.ReadLine().Split(' ');
        int A = int.Parse(a[0]);
        int N = int.Parse(a[1]);
        if(A > 4*N - 2)
        {
            Console.WriteLine(((A - (N * 2)) / 2 + 1) + " " + ((A - (N * 2)) / 2 - 1));
            Console.WriteLine(N + " " + (A % 2));
            Console.WriteLine(N + " 0");
        }
        else if (A >= 3 * N)
        {
            Console.WriteLine(N + " " + (A-3*N));
            Console.WriteLine(N + " 0");
            Console.WriteLine(N + " 0");
        }
        else
        {
            Console.WriteLine("-1");
        }

    }
}