#include<bits/stdc++.h>
using namespace std;
long long n,a,prosek,levi,desni,zbirdonjih,ostatak;
int main()
{
    scanf("%lld %lld",&n,&a);
    if(n/3>a)
    {
        prosek=n/3/2;
        levi=n/3/2+n%3;
        desni=n/3/2;
        zbirdonjih=4*(prosek);
        ostatak=n-zbirdonjih;
        for(int i=1;i<=2;i++)
        {
            cout<<prosek+1<<" "<<prosek-1<<endl;
        }
        if(ostatak%2==0)
        {
            cout<<ostatak/2+1<<" "<<ostatak/2-1<<endl;
        }
        else
        {
            cout<<ostatak-(ostatak/2-1)<<" "<<ostatak/2-1<<endl;
        }
        return 0;
    }
    else
    {
        cout<<"-1"<<endl;
        return 0;
    }
    return 0;
}