#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  if (m == 3 && n != 4 && n != 3) {
    cout << -1;
    return false;
  }
  int x = 0, y = 0;
  for (int i = 1; i <= m; i++) {
    cout << x << " " << y << endl;
    x++;
    y += i;
  }
  x = 1000000, y = 0;
  for (int i = 1; i <= n - m; i++) {
    cout << x << " " << y << endl;
    x--;
    y += i;
  }
}
