#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double PI = acos(-1);
const double EPS = 1e-8;
int main() {
  int n, m;
  while (cin >> n >> m) {
    if (m == 3 && n >= 5) {
      cout << -1 << endl;
      continue;
    }
    const int X = 10000000;
    for (int i = 0; i < (int)m; ++i) cout << i << " " << X + i * i << endl;
    for (int i = 0; i < (int)n - m; ++i) cout << i << " " << -X - i * i << endl;
  }
}
