#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n, a, p1, p2, tmp, end;
    cin >> n;
    cin >> a;
    p1 = 0;
    p2 = 0;
      if((3*a) > n){
 cout << -1;
     return 0;
      }


  {
    {  p1 = a;
        cout << p1 << " " <<  p2 << endl;
    }

      {
        p1 = a;
        cout << p1 << " " <<  p2 << endl;
    }

 {
     if(p1 < a){
            p2 -= a - p1;
     tmp = a - p1;
     p1 += tmp;}



    p2 = (((n - 2*a) - 2) / 2 );
    p1 = p2 + 2;
    if(p1 < a){
            p2 -= a - p1;
     tmp = a - p1;
     p1 += tmp;}


    cout << p1 << " " <<  p2 << endl;
    }

 cout << endl;

    }




    return 0;
}