#include <bits/stdc++.h>

using namespace std;

#define pii pair<int,int>
#define ll long long
#define s second
#define f first

ll n,a,y;

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

    y=(n-2*a-1)/2;
    cout << y << " " << y-2 << endl;
    cout << a << " " << 1 << endl;
    cout << a << " " << 2 << endl;
  }

  return 0;
}