#include <bits/stdc++.h>
using namespace std;
int n, a, prvi, drugi;
int main() {
cin >> n >> a;
if (n == a or a > n) {
    cout << -1 << endl;
    return 0;
}
cout << a << " "<< 0 << endl;
cout << a << " " <<0 << endl;
n-=2*a;
cout << n/2+1 << " " << n/2-1 << endl;





return 0;
}