using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _2___Odbojka_Hotfix
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = Convert.ToInt32(Console.Read());
            int A = Convert.ToInt32(Console.Read());

            int P = ((N - 2 * A) / 2) + 1;
            int Z = P - 2;

            if (N < 3 * A)
            {
                Console.WriteLine("-1");
            }
            else
            {
                if (N % 2 == 0)
                {
                    Console.WriteLine(A + " " + 0);
                }
                else
                {
                    Console.WriteLine(A + " " + 1);
                }

                Console.WriteLine(A + " " + 0);
                Console.WriteLine(P + " " + Z);
            }
            Console.ReadLine();
        }
    }
}