#include <bits/stdc++.h>
#include<math.h>
using namespace std;
long long int abs(long long int a,long long int b)
{
    if(a>b)return a-b;
    return b-a;
}
int main()
{
    long long int n, a;
    cin >> n >> a;
    if(n/3<a)cout << -1;
    long long int broj = n/3;
    long long int ostatak = n%3;

    for(int i = 0;i<3;i++)
    {
        long long int d,b;
        d = broj-a;
        b = broj-d;
        if(i==0)d+=ostatak;
        if(abs(d-b)<2){d+=2;b-=2;}
        cout << d << " " << b << endl;


    }


    return 0;
}