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