#include <bits/stdc++.h>
using namespace std;
static const int INF = 500000000;
template <class T>
void debug(T a, T b) {
  for (; a != b; ++a) cerr << *a << ' ';
  cerr << endl;
}
int n, m;
int main() {
  cin >> n >> m;
  if (m == 3 && n >= 5)
    puts("-1");
  else if (m == 3 && n == 4)
    printf("0 0\n3 0\n0 3\n1 1\n");
  else {
    for (int i = 0; i < m; ++i) printf("%d %d\n", i, i * i + 10000000);
    for (int i = 0; i < n - m; ++i) printf("%d %d\n", i, -i * i - 10000000);
  }
  return 0;
}
