#include <bits/stdc++.h>
#include<math.h>
using namespace std;

int main()
{
    long long int n, a;
    cin >> n >> a;
    if(n< 6*a-6)cout << -1;
    else
    {
        int ostatak = 0;
        if(n%2!=0)ostatak = n%2;
        cout << a << " "<< a-2-ostatak << endl;
        n = n-2*a+2+ostatak;
        n/=2;
        long long int y;
        y = n-a+2;
        cout << a-2 << " " << a << endl;

        cout << y << " "<< y-2<<endl;





    }






    return 0;
}