#include <bits/stdc++.h>

using namespace std;

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

    int n, a;

    cin >> n >> a;

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

    int first = a, second = 0, sc2=0;

    if(n <= a-2)
    {
        second += n;
    }
    else
    {
        second += first-2;
        n-=first-2;

        if(n%2 == 0)
        {
            first+=n/2;
            second+=n/2;
        }
        else
        {
            first+=n/2;
            second+=n/2;
            sc2=1;
        }
    }


    cout << first << " " << second << "\n";
    cout << a << " " << sc2 << "\n";
    cout << a << " 0\n";
}