#include <iostream>

using namespace std;

int main()
{
    unsigned long long int matchPoints, setMinimum, win[5]={0}, lose[5]={0};
    cin >> matchPoints >> setMinimum;

    if(matchPoints < 3*setMinimum || (matchPoints>5 && setMinimum == 1) || setMinimum==0)
    {
        cout << -1 << endl;
    }
    else if(matchPoints >= 3*setMinimum && matchPoints < 4*setMinimum)
    {
        for(int i = 0; i<3;i++)win[i]=setMinimum;
        matchPoints = matchPoints - 3*setMinimum;
        if(matchPoints <= (setMinimum-2))lose[0]+=matchPoints;
        else
        {
            lose[0]+=(setMinimum-2);
            matchPoints-=(setMinimum-2);
            if(matchPoints%2 == 1) lose[2]+=1;
            win[0]+=matchPoints/2; lose[0] += matchPoints/2;
        }
        win[0]+=matchPoints/2; lose[0] += matchPoints/2;
        if(lose[2]>(win[2]-2)){cout << -1 << endl;return 0;}
        for(int i = 0; i<3;i++)cout << win[i] << " " << lose[i] << endl;
    }
    else if(matchPoints >= 4*setMinimum && matchPoints < 5*setMinimum)
    {
        for(int i = 0; i<4;i++)win[i]=setMinimum;
        matchPoints = matchPoints - 4*setMinimum;
        if(matchPoints <= (setMinimum-2))lose[0]+=matchPoints;
        else
        {
            lose[0]+=(setMinimum-2);
            matchPoints-=(setMinimum-2);
            if(matchPoints%2 == 1) lose[3]+=1;
            win[0]+=matchPoints/2; lose[0] += matchPoints/2;
        }
        int pom = lose[2];
        lose[2]= win[2];
        win[2] = pom;
        if(lose[3]>(win[3]-2)){cout << -1 << endl;return 0;}
        for(int i = 0; i<4;i++)cout << win[i] << " " << lose[i] << endl;
    }
    else
    {
        for(int i = 0; i<5;i++)win[i]=setMinimum;
        matchPoints = matchPoints - 5*setMinimum;
        if(matchPoints <= (setMinimum-2))lose[0]+=matchPoints;
        else
        {
            lose[0]+=(setMinimum-2);
            matchPoints-=(setMinimum-2);
            if(matchPoints%2 == 1) lose[4]+=1;
            win[0]+=matchPoints/2; lose[0] += matchPoints/2;
        }
        int pom = lose[2];
        lose[2]= win[2];
        win[2] = pom;
        pom = lose[3];
        lose[3]= win[3];
        win[3] = pom;
        if(lose[4]>(win[4]-2)){cout << -1 << endl;return 0;}
        for(int i = 0; i<5;i++)cout << win[i] << " " << lose[i] << endl;
    }
    return 0;
}