#include <bits/stdc++.h>
#include<math.h>
using namespace std;

int main()
{
    long long int n, a;
    cin >> n >> a;
    if(n< 3*a)cout << -1;
    else if(n<6*a-6)
    {
        int deli = (n-3*a);
        int ostatak = deli%3;
        deli = deli/3;
        cout << a << " " << deli<< endl;
        if(ostatak==2)
        {
        cout << a << " " << deli+1 << endl;
        cout << a << " " << deli+1;
        }
        else
        {
            cout << a << " " << deli+1 << endl;
            cout << a << " " << deli << endl;
        }




    }
    else
    {
        int ostatak = 0;
        if(n%2!=0)ostatak = n%2;
        cout << a << " "<< a-2-ostatak << endl;
        n = n-2*a+2+ostatak;
        n/=2;
        long long int y;
        y = n-a+2;
        cout << a << " " << a-2 << endl;

        cout << y << " "<< y-2<<endl;





    }






    return 0;
}