#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a, n, br1 = 0, br2 = 0, br = 0, brp, provera;
    cin >> a >> n;
    if(a % 2 == 0){
    br = a - (2 * n - 2);
    if(br % 2 != 0) br = a - (2 * n - 4);
    br /= 2;
    }
    else{
        br = a - (2 * n - 3);
        if(br % 2 != 0) br = a - (2 * n - 5);
        br /= 2;
    }
    br1 = br / 2 + 2;
    br2 = br / 2;
    brp = a - (2 * br1 + 2 * br2);
    provera = a - (2 * br1 + 2 * br2 + n + brp - n);
    if(provera != 0 || br1 < n) cout << -1;
    else{
    cout << br1 << " " << br2 << endl;
    cout << br1 << " " << br2 << endl;
    cout << n << " " << brp - n;
    }
    return 0;
}