#include <bits/stdc++.h>

using namespace std;

int main()
{
    vector<pair<long int, long int>> sol;
    long int n,a;
    cin >> n >> a;
    if(n<3*a){
        cout << -1;
    }
    else if(a==2 && n%2!=0){
        cout << -1;
    }
    else{
        n-=3*a;
        if(n==0){
            for(int i=0;i<3;i++)sol.push_back(make_pair(a, 0));
        }
        else if(n<=3*(a-2)){
            for(int i=0;i<3;i++){
                if(n>=a-2){
                    sol.push_back(make_pair(a, a-2));
                    n-=a-2;
                }
                else{
                    sol.push_back(make_pair(a, n));
                    n=0;
                }
            }
        }
        else if(n%2!=0){
                n-=1;
                sol.push_back(make_pair(n/2+1,n/2-1));
                sol.push_back(make_pair(1, a));
                sol.push_back(make_pair(0, a));
                sol.push_back(make_pair(0, a));
            }
        else {
                sol.push_back(make_pair(n/2+1, n/2-1));
                sol.push_back(make_pair(0, a));
                sol.push_back(make_pair(0, a));
                sol.push_back(make_pair(0, a));
        }
    }
    for(auto x:sol){
        cout << x.first << " " << x.second << endl;
    }
    return 0;
}