#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn = 100005;
int main()
{
    ll n, a;
    cin >> n >> a;
    if(n<3*a)return cout << -1 << endl, 0;
    if(n%2 == 0){
        cout << 0 << " " << a << endl;
        cout << 0 << " " << a << endl;
        n-=2*a;
        ll x=(n+2)/2;
        cout << n-x << " " << x << endl;
    }
    else{
        cout << 1 << " " << a << endl;
        cout << 0 << " " << a << endl;
        n-=1+2*a;
        ll x=(n+2)/2;
        cout << n-x << " " << x << endl;
    }
    return 0;
}