#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%2 == 1 && a == 2)return cout << -1, 0;
    if(n<3*a)return cout << -1 << endl, 0;
    if(n == 3*a){
        cout << 0 << " " << a << endl;
        cout << 0 << " " << a << endl;
        cout << 0 << " " << a << endl;
        return 0;
    }
    cout << 0 << " " << a << endl;
    n-=2*a;
    if(n%2 == 1){
        cout << 1 << " " << a << endl;
        n--;
    }
    else cout << 0 << " " << a << endl;
    if(n<2*a){
        cout << n-a << " " << a << endl;
    }
    else{
        cout << (n-2)/2 << " " << (n+2)/2 << endl;
    }
    return 0;
}