#include <iostream>
using namespace std;


int main()
{
  int N, A;
  cin >> N >> A;
  if(6 * (A - 1) > N)
  {
    cout << -1 << endl;
  }
  else
  {
    int x;
    if(N % 2)
    {
      x = 1;
      cout << A << " " << A - 3 << endl;
    }
    else
    {
      x = 2;
      cout << A << " " << A - 2 << endl;
    }
    int i = N - 4 * (A - 1) - x;
    cout << A << " " << A - 2 << endl;
    cout << i / 2 + 2 << " " << i / 2 << endl;
  }
  return 0;
}