#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
template <class T>
bool get_max(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
template <class T>
bool get_min(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
int n, m;
int main() {
  cin >> n >> m;
  if (m == 3 && n > 4) {
    cout << -1 << endl;
    return 0;
  }
  for (int i = 1; i <= m; i++) {
    cout << i << " " << i * i << endl;
  }
  for (int i = 1; i <= n - m; i++) {
    cout << i << " " << 0 - m * m - i * i << endl;
  }
  return 0;
}
