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