#include <iostream>
#include <cstdio>
using namespace std;

void printer(int a, int b)
{
    cout << a << " " << b << endl;
}
void bodovi3(int n, int a)
{
    printer(a, n / 3);
    printer(a, (n - n / 3) / 2);
    printer(a, n - (n - n / 3) / 2);
}
void odbojka(int n, int a)
{
    if(n < max(3 * a, 6))
    {
        cout << -1;
        return;
    }
    if(n < 6 * a - 6)
    {
        bodovi3(n - 3 * a, a);
        return;
    }
    if(n < 6 * a)
    {
        cout << 0 << " " << a << endl;
        bodovi3(n - 4 * a, a);
        return;
    }
    int x = n / 6;
    int d = n % 6;
    switch (d)
    {
    case 0:
        bodovi3(n, x);
        break;
    case 2:
        printer(x + 2, x);
        printer(x + 1, x - 1);
        printer(x + 1, x - 1);
        break;
    case 4:
        printer(x + 3, x + 1);
        printer(x + 1, x - 1);
        printer(x + 1, x - 1);
        break;
    case 5:
    case 3:
    case 1:
        printer(a, a % 2);
        odbojka(n - a - (a % 2), a);
    }
}

int main()
{
    long int n, a;
    cin >> n >> a;
    odbojka(n, a);
    return 0;
}