#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3) {
    if (n >= 5) {
      cout << -1;
      return 0;
    }
    if (n == 4) {
      cout << "0 0\n3 0\n0 3\n1 1\n";
      return 0;
    }
  }
  int t = 10000000;
  for (int(x) = (0); x < (m); ++(x)) cout << x << " " << x * x + t << endl;
  for (int(x) = (0); x < (n - m); ++(x)) cout << x << " " << -t - x * x << endl;
  return 0;
}
