#include <iostream>
#include<bits/stdc++.h>
using namespace std;
vector<int> rez1,rez2;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //bool moguce=true;
    int i,n,a;
    cin >> n >> a;
    if((long long)a*3>n)
        cout << -1;
    else
    {
        if(a==2)
        {
            if(n%2==1)
                cout << -1;
            else
            {
                rez1.push_back(2);
                rez1.push_back(2);
                rez2.push_back(0);
                rez2.push_back(0);
                n=n-4;
                rez1.push_back(n/2+1);
                rez2.push_back(n/2-1);
                for(i=0;i<3;i++)
                    cout << rez1[i] << " " << rez2[i] << endl;
            }
        }
        else
        {
            if(n%2==0 || 3*a==n)
            {
                rez1.push_back(a);
                rez1.push_back(a);
                rez2.push_back(0);
                rez2.push_back(0);
                n=n-2*a;
                if(n>=2*a)
                {
                    rez1.push_back(n/2+1);
                    rez2.push_back(n/2-1);
                }
                else
                {
                    rez1.push_back(a);
                    rez2.push_back(n-a);
                }
                for(i=0;i<3;i++)
                    cout << rez1[i] << " " << rez2[i] << endl;
            }
            else
            {
                rez1.push_back(a);
                rez1.push_back(a);
                rez2.push_back(1);
                rez2.push_back(0);
                n=n-2*a-1;
                if(n>=2*a)
                {
                    rez1.push_back(n/2+1);
                    rez2.push_back(n/2-1);
                }
                else
                {
                    rez1.push_back(a);
                    rez2.push_back(n-a);
                }
                for(i=0;i<3;i++)
                    cout << rez1[i] << " " << rez2[i] << endl;
            }
        }
    }
    //cout << "Hello world!" << endl;
    return 0;
}