#include<bits/stdc++.h>

using namespace std;

int main()
{
    long long n,a;
    cin>>n>>a;

    long long tri_seta=3*a;

    long long ost_tri_seta=3*(a-2);

    long long stvarni_ost_tri_seta=n-3*a;

    if (n<3*a) cout<<-1;

    else if (n<3*a+3*(a-2))
    {
        long long x=(stvarni_ost_tri_seta+1)/3;
        cout<<a<<" "<<x<<endl;
        cout<<a<<" "<<x<<endl;
        cout<<a<<" "<<stvarni_ost_tri_seta-2*x;
    }

    else if (n==3*a+3*(a-2))
    {
        cout<<a<<" "<<a-2<<endl;
        cout<<a<<" "<<a-2<<endl;
        cout<<a<<" "<<a-2<<endl;
    }

    else
    {
        if (n%2==1)
        {
            cout<<a<<" "<<a-3<<endl;
            cout<<a<<" "<<a-2<<endl;
            long long ost=n-2*a-(a-3)-(a-2);
            cout<<ost/2+1<<" "<<ost/2-1;
        }
        else
        {
            cout<<a<<" "<<a-2<<endl;
            cout<<a<<" "<<a-2<<endl;
            long long ost=n-2*a-(a-2)-(a-2);
            cout<<ost/2+1<<" "<<ost/2-1;
        }
    }

    return 0;
}