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



return 0;
}