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

namespace Petlja_B___Odbojka
{
    class Program 
    {
        static void Main(string[] args)
        {

            string[] str = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(str[0]);
            int n = Convert.ToInt32(str[1]);

            if(a/n>=3)
            {
                int k = n + (n - 2);

                if(a/k>=3)
                {
                    int br = 0;

                    bool neparan = a % 2!=0;

                    while (a / k != 1 && br<4)
                    {
                        if(neparan && br==0)
                        {
                            Console.WriteLine(n + " " + (n - 3));
                            br++;
                            a -= k+1;
                        }
                        else
                        {
                            if (br < 2)
                                Console.WriteLine(n + " " + (n - 2));
                            else
                                Console.WriteLine((n - 2) + " " + n);
                            br++;
                            a -= k;
                        }
                    }
                    if (a > (2 * n) - 2)
                    {
                        if (a % 2 == 0)
                        {
                            Console.WriteLine((a / 2) + 1 + " " + ((a / 2) - 1));
                        }
                        else
                        {
                            Console.WriteLine((a / 2) + 2 + " " + ((a / 2) - 1));
                        }
                    }
                    else
                    {
                        Console.WriteLine(n + " " + (a - n));
                    }
                }
                else
                {
                    int br = 0;

                    bool neparan = a % 2 != 0;

                    while (a / n != 1 && br<4)
                    {
                        if (neparan && br == 0)
                        {
                            Console.WriteLine(n + " " +"1");
                            br++;
                            a -= n + 1;
                        }
                        else
                        {
                            if (br < 2)
                                Console.WriteLine(n + " " + "0");
                            else
                                Console.WriteLine("0" + " " + n);
                            br++;
                            a -= n;
                        }
                    }
                    if (a >(2*n)- 2)
                    {
                        if (a % 2 == 0)
                        {
                            Console.WriteLine((a / 2) + 1 + " " + ((a / 2) - 1));
                        }
                        else
                        {
                            Console.WriteLine((a / 2) + 2 + " " + ((a / 2) - 1));
                        }
                    }
                    else
                    {
                        Console.WriteLine(n+" "+(a-n));
                    }
                   
                }
            }
            else
            {
                Console.WriteLine("-1");
            }
            Console.ReadLine();

        }
    }
}