#include <bits/stdc++.h>
using namespace std;
int n, m;
int main(int argc, char *argv[]) {
  cin >> n >> m;
  if (m == 3) {
    if (n == 3) {
      cout << 0 << " " << 0 << endl;
      cout << 0 << " " << 1 << endl;
      cout << 1 << " " << 1 << endl;
    }
    if (n == 4) {
      cout << 0 << " " << 0 << endl;
      cout << 3 << " " << 0 << endl;
      cout << 0 << " " << 3 << endl;
      cout << 1 << " " << 1 << endl;
    }
    if (n >= 5) cout << -1 << endl;
  } else {
    for (int i = 0; i < m; i++) {
      cout << i << " " << 30000 + i * i << endl;
    }
    for (int i = 0; i < n - m; i++) cout << i << " " << -i * i << endl;
  }
  return 0;
}
