#include <bits/stdc++.h>

using namespace std;

int n, a;
int sets[5][2];
int leftoverPoints;

int doSet(int setNum)
{
    leftoverPoints = n-a*setNum;
    for (int i = 0; i < setNum; ++i)
    {
        sets[i][0] = a;
    }
    if (leftoverPoints <= (a-2)*setNum)
    {
        for (int i = 0; i < setNum; ++i)
        {
            if (leftoverPoints >= a-2)
            {
                sets[i][1] = a-2;
                leftoverPoints -= a-2;
            }
            else
            {
                sets[i][1] = leftoverPoints;
                leftoverPoints = 0;
            }
        }
    }
    else
    {
        leftoverPoints -= (a-2)*setNum;
        for (int i = 0; i < 3; ++i)
        {
            sets[i][1] = a-2;
        }
        if (leftoverPoints % 2 == 0)
        {
            sets[0][0] += leftoverPoints/2;
            sets[0][1] += leftoverPoints/2;
        }
        else
        {
            --sets[setNum-1][1];
            ++leftoverPoints;
            sets[0][0] += leftoverPoints/2;
            sets[0][1] += leftoverPoints/2;
        }
    }
}


int p1, p2, pointsUsed;
bool checkSets(int s)
{
    p1 = 0;
    p2 = 0;
    pointsUsed = 0;
    for (int i = 0; i < s; ++i)
    {
        if (sets[i][0] > sets[i][1])
        {
            ++p1;
        }
        else
        {
            ++p2;
        }
        pointsUsed += sets[i][0] + sets[i][1];
        if (sets[i][0]-sets[i][1] < 2 && sets[i][0]-sets[i][1] > -2)
        {
            return false;
        }
    }
    if ((p1 == 3 && p2 < 3 || p2 == 3 && p1 < 3) && pointsUsed == n)
    {
        return true;
    }
    else
    {
        return false;
    }
}

int main()
{
    scanf("%d %d", &n, &a);
    if (n/a < 3)
    {
        printf("-1\n");
    }
    else
    {
        doSet(3);
        bool pass = checkSets(3);
        if (pass == true)
        {
            for (int i = 0; i < 3; ++i)
            {
                printf("%d %d\n", sets[i][0], sets[i][1]);
            }
            return 0;
        }
        doSet(4);
        pass = checkSets(4);
        if (pass == true)
        {
            for (int i = 0; i < 4; ++i)
            {
                printf("%d %d\n", sets[i][0], sets[i][1]);
            }
            return 0;
        }
        doSet(5);
        pass = checkSets(5);
        if (pass == true)
        {
            for (int i = 0; i < 5; ++i)
            {
                printf("%d %d\n", sets[i][0], sets[i][1]);
            }
            return 0;
        }
        printf("-1\n");
    }

    return 0;
}