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

namespace Odbojka
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] linija = Console.ReadLine().Split(new Char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(item => int.Parse(item)).ToArray();
            long N = linija[0];
            long A = linija[1];
            if (A >= N || N <= 3 * A || N == 0 || A == 0)
            {
                Console.WriteLine(-1);
                Console.ReadKey();
            }
            else if (N % 2 == 0)
            {
                Console.WriteLine(((N - 2 * A) / 2 - 1) + " " + ((N - 2 * A) / 2 + 1));
                Console.WriteLine(A + " " + 0);
                Console.WriteLine(A + " " + 0);
                Console.ReadKey();

            }
            else
            {
                N = N - 1;
                Console.WriteLine((N - 2 * A + 1) + " " + (N - 2 * A - 1));
                Console.WriteLine(A + " " + 1);
                Console.WriteLine(A + " " + 0);
                Console.ReadKey();

            }
            }
        }
    }