#include <bits/stdc++.h>

using namespace std;

int n, a, rounds;
bool isCorrect = true;
vector<pair<int, int> > res;

int solve(int rounds) {
    if (rounds <= 2) {
        isCorrect = false;
        return 0;
    }

    int rem = n;
    bool firstWin = true;

    for (int i = 0; i < rounds; ++i) {
        rem -= 2 * (a - 1);
        if (firstWin) {
            res.emplace_back(make_pair(a, a - 2));
        } else {
            res.emplace_back(make_pair(a - 2, a));
        }

        firstWin = !firstWin;
    }

    int index = res.size() - 1;
    while (rem > 0) {
        rem -= 2;
        ++res[index].first, ++res[index].second;
        --index;

        if (index < 0) {
            index = res.size() - 1;
        }
    }

    index = res.size() - 1;
    while (rem < 0 && index >= 0) {
        if (index % 2 == 0) {
            if (res[index].second == 0) {
                --index;
            } else {
                --res[index].second;
                ++rem;
            }
        } else {
            if (res[index].first == 0) {
                --index;
            } else {
                --res[index].first;
                ++rem;
            }
        }
    }

    if (rem != 0) {
        res.clear();
        return solve(rounds - 1);
    }

    return 1;
}

int main()
{
    scanf("%d %d", &n, &a);

    if (n >= 5*a) {
        rounds = 5;
    } else if (n >= 4*a) {
        rounds = 4;
    } else if (n >= 3*a){
        rounds = 3;
    } else {
        rounds = 0;
    }

    solve(rounds);

    if (isCorrect) {
        for (int i = 0; i < rounds; ++i) {
            printf("%d %d\n", res[i].first, res[i].second);
        }
    } else {
        printf("-1");
    }
}