//Failure will never overtake me if my determination to succeed is strong enough
#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);

    long long  n, a;
    cin >> n >> a;

    pair<long long, long long> p[3];

    if(n < 3*a)
    {
        cout << -1;
        return 0;
    }

    p[0].first = p[1].first = a;
    p[1].second = p[1].second = 0;

    n -= 2*a;

    if((n+1)/2 >= a)
    {
        if(n&1)
        {
            p[0].second = 1;
            n--;
        }

        p[2].first = n/2+1;
        p[2].second = n/2-1;
    }

    else
    {
        p[2].first = a;
        n -= a;
        p[2].second = n;
    }

    for(int i = 0; i < 3; i++)
        cout << p[i].first << " " << p[i].second << "\n";


}