#include <bits/stdc++.h>

using namespace std;



int main()
{
    int p, n;
    cin >> p >> n;
    vector<int> mika;
    vector<int> zika;

    if(p < n * 3 || (p > 10 * (n - 1) && (p - 10 * (n - 1) % 2) != 0))
        cout << -1;
    else if(p <= 6 * (n - 1)){
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);

        int k = p - 3 * n;
        int i = 0;
        while(i < 3){
            zika.push_back(min(n - 2, k));
            k -= min(n - 2, k);
        }
    }
    else if(p <= 8 * (n - 1)){
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);

        int k = p - 4 * n;
        int i = 0;
        while(i < 4){
            zika.push_back(min(n - 2, k));
            k -= min(n - 2, k);
        }
        mika[0] = zika[0];
        zika[0] = n;
    }
    else if(p <= 10 * (n - 1)){
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n);

        int k = p - 5 * n;
        int i = 0;
        while(i < 5){
            zika.push_back(min(n - 2, k));
            k -= min(n - 2, k);
        }
        mika[0] = zika[0];
        zika[0] = n;
        mika[1] = zika[1];
        zika[1] = n;
    }
    else{
        mika.push_back(n);
        mika.push_back(n);
        mika.push_back(n - 2);
        mika.push_back(n - 2);

        zika.push_back(n - 2);
        zika.push_back(n - 2);
        zika.push_back(n);
        zika.push_back(n);

        int sred = (p - 8 * (n - 1)) / 2;
        mika.push_back(sred + 1);
        zika.push_back(sred - 1);
    }

    for(int i = 0; i < mika.size(); i++){
        cout << mika[i] << " " << zika[i] << endl;
    }
}