//odbojka
#include <iostream>
#include <vector>

using namespace std;

int a, n, brs;
vector <int> p(5), d(5);

void kraj()
{
    for (int i = 0; i < brs; i++) cout << p[i] << " " << d[i] << "\n";
    return;
}
int main()
{
    int i;
    cin >> n >> a;
    if (n < 3*a) {cout << "-1"; return 0;}
    for (brs = 0; brs < 5 && n >= a; brs++)
    {
        if (brs % 2 == 0) p[brs] = a;
        else d[brs] = a;
        n -= a;
    }
    p.resize(brs);
    d.resize(brs);
    for (i = 0; i < brs && n >= a-2; i++)
    {
        if (i % 2 == 0) d[i] = a-2;
        else p[i] = a-2;
        n -= a-2;
    }
    if (i < brs && n > 0)
    {
        if (i % 2 == 0) d[i] = n;
        else p[i] = n;
        n = 0;
    }
    if (n == 0) {kraj(); return 0;}
    while (n > 1) {p[0]++; d[0]++; n -= 2;}
    if (n == 0) {kraj(); return 0;}
    p[0]++;
    d[0]++;
    p[1]--;
    kraj();
    return 0;
}