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