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