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

namespace Zadatak_2
{
    class Program
    {
        static void Main(string[] args)
        {
            long N = long.Parse(Console.ReadLine());
            long A = long.Parse(Console.ReadLine());
            Nemoguce(N, A);

        }
        static void Nemoguce(long N,long A)
        {
            if (N < 2 || N < 3 * A||A==0||A==1||(N%2==1&&A==2))
                Console.WriteLine("-1");
            else Rezultat_Po_Setovima(N,A);
        }
        static void Rezultat_Po_Setovima(long N,long A)
        {
            if(N%2==0)
            {
                Console.WriteLine("{0} 0", A);
                Console.WriteLine("{0} 0", A);
                Console.WriteLine("{0} {1}", (N - 2 * A) / 2 + 1, (N - 2 * A) / 2 - 1);
            }
            else
            {
                    Console.WriteLine("{0} 1", A);
                    Console.WriteLine("{0} 0", A);
                    Console.WriteLine("{0} {1}", (N - 2 * A) / 2 + 1, (N - 2 * A) / 2 - 1);
            }
        }
    }
}