#include<iostream>
#include<vector>

int main(){
    int n;
    int a;

    std::cin >> n >> a;

    if(n < 3 * a){
        std::cout << -1 << std::endl;
        return 0;
    }

    std::vector<int> x;
    std::vector<int> y;

    if(n <= ((6 * a) - 7)){
        for(int i = 0; i < 3; ++i){
            x.push_back(a);
            y.push_back((n - 3*a) / 3);
        }
        int k = (n - 3*a) % 3;
        if(k >= 1){
            y[0]++;
        }
        if(k >= 2){
            y[1]++;
        }

        for(int i = 0; i < 3; ++i){
            std::cout << x[i] << " " << y[i] << std::endl;
        }
    }
    else{
        for(int i = 0; i < 3; ++i){
            x.push_back(a);
            if(!i)
                y.push_back(a-3);
            else
                y.push_back(a-2);
        }

        int s = 6*a - 7;

        while(s < n){
            if((n - s) % 2){
                y[0]++;
                s++;
            }
            else{
                x[2]++;
                y[2]++;
                s += 2;
            }
        }

        for(int i = 0; i < 3; ++i){
            std::cout << x[i] << " " << y[i] << std::endl;
        }
    }

    return 0;
}