#include <iostream>

int main()
{
    unsigned long long N, A;
    std::cin >> N >> A;

    unsigned long long maxset = std::min(N / A, (unsigned long long) 5);
    unsigned long long rem = N - (A * maxset);
    unsigned long long div = rem / maxset;
    unsigned long long mod = rem % maxset;

    while (div > (A - 2))
    {
        div--;
        mod++;
    }

    if (rem == 0)
    {
        std::cout << -1;
        return 0;
    }

    for (int i = 1; i <= maxset; i++)
    {
        unsigned long long addToA = 0, addToD = 0;

        if (mod % 2 != 0)
        {
            while ((div + addToD) < (A - 2) && mod > 0)
            {
                addToD++;
                mod--;
            }
        } else {
            addToA = (i == maxset ? (mod / 2) : 0);
            addToD = addToA;
        }

        std::cout << A + addToA << " " << div + addToD << "\n";
    }

    return 0;
}