#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll n,a;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> a;
    if(n < 3*a){
        cout << -1 << endl;
        return 0;
    }
    if(a == 2 && n%2 != 0){
        cout << -1 << endl;
        return 0;
    }
    if(n <= 4*a-2){
        cout << a << " " << n-3*a << endl;
        cout << a << " " << 0 << endl;
        cout << a << " " << 0 << endl;
        return 0;
    }
    if(n <= 5*a-4){
        cout << a << " " << a-2 << endl;
        cout << a << " " << n-4*a+2 << endl;
        cout << a << " " << 0 << endl;
        return 0;
    }
    if(n <= 6*a-6){
        cout << a << " " << a-2 << endl;
        cout << a << " " << a-2 << endl;
        cout << a << " " << n-5*a+4 << endl;
        return 0;
    }
    ll ostalo = n-6*(a-1);
    if(ostalo%2 == 0){
        cout << a+ostalo/2 << " " << a-2+ostalo/2 << endl;
        cout << a << " " << a-2 << endl;
        cout << a << " " << a-2 << endl;
    }
    else{
        /// a != 2
        cout << a+(ostalo+1)/2 << " " << a-2+(ostalo+1)/2 << endl;
        cout << a << " " << a-3 << endl;
        cout << a << " " << a-2 << endl;
    }
}