#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    int n,a;
    cin>>n>>a;
    if(a>=n||n<a*3 )
        cout<<-1;
    else
    {
      int c=n-(5*a+5*(a-2));
      int b=c/2;
      int o=c%2;
      switch(o)
      {
      case 0:
        cout<<a+b <<" " <<a-2+b<<endl;
        cout<<a <<" " <<a-2<<endl;
        cout<<a <<" " <<a-2<<endl;
        break;
      case 1:
        cout<<a+b <<" " <<a-2+b<<endl;
        cout<<a+1 <<" " <<a-1<<endl;
        cout<<a <<" " <<a-3<<endl;
        break;

       }
    }

    return 0;
}