/// created by ricpe13 ///
#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    /////////////////////////////////


    int n,a;
    cin >> n >> a;
    if (a>=n){
        cout << "-1" << endl;
        return 0;
    }
    if (n-a==1){
        cout << "-1" << endl;
        return 0;
    }
    cout << a << " " << "0" << endl;
    cout << "0" << " " << a << endl;
    cout << a << " " << "0" << endl;
    cout << "0" << " " << a << endl;
    cout << a << " " << n-(5*a) << endl;
    return 0;
}