#include <iostream>
#include <string> 
using namespace std;



int main()
{
    int n,a;
    cin >> n >> a;
    if(n<3*a) cout << -1;
    else if(n==3*a) for(int i=0;i<3;i++) cout << a << " 0\n";
    else
    {
        cout << a << " 0" << endl;
        if((n-2*a)%2) cout << a << " 1";
        else cout << a << " 0";
        cout << endl;
        n-=2*a;
        n-=(n%2);
        if(n<=2*a-2) cout << a << " " << n-a;
        else cout << (n-2)/2 + 2 << " " << (n-2)/2; 
        
    }
    return 0;
}