#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3) {
    if (n == 3) {
      cout << 0 << ' ' << 0 << endl;
      cout << 0 << ' ' << 1 << endl;
      cout << 1 << ' ' << 0 << endl;
    }
    if (n == 4) {
      cout << 0 << ' ' << 0 << endl;
      cout << 2 << ' ' << 0 << endl;
      cout << 1 << ' ' << 1 << endl;
      cout << 0 << ' ' << 3 << endl;
    }
    if (n >= 5) {
      cout << -1;
    }
  } else {
    int up = 10000000;
    for (int i = 0; i < m; ++i) {
      cout << i << ' ' << i * i + up << endl;
    }
    for (int i = 0; i < n - m; ++i) {
      cout << -i << ' ' << -i * i - up << endl;
    }
  }
  return 0;
}
