#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;
    } else if (n == 4) {
      cout << "0 0" << endl;
      cout << "3 0" << endl;
      cout << "0 3" << endl;
      cout << "1 1" << endl;
    } else {
      cout << -1;
    }
    return 0;
  }
  for (int i = 1; i <= m; ++i) {
    cout << i << " " << i * i << endl;
  }
  for (int i = 1; i < n - m + 1; ++i) {
    cout << i << " " << -i * i - 100000 << endl;
  }
  return 0;
}
