#include <iostream>
#include <cmath>

using namespace std;
int main() {
  unsigned long long a,n,g;
  cin>>n>>a;
  if(n/3<a)
  {
    cout<<(-1);
  }
  else
  {
    if (n%2==0)
    {
      cout<<a<<" "<<0<<endl;
      cout<<a<<" "<<0<<endl;
      g=n-2*a;
      cout<<(g/2)+1<<" "<<(g/2)-1<<endl;
    }
    else
    {
      cout<<a<<" "<<1<<endl;
      cout<<a<<" "<<0<<endl;
      g=n-2*a-1;
      cout<<(g/2)+1<<" "<<(g/2)-1<<endl;
    }
  }
}