#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  if (M == 3) {
    if (N == 3)
      cout << "0 0\n3 0\n0 3";
    else if (N == 4)
      cout << "0 0\n3 0\n0 3\n1 1";
    else
      cout << "-1";
    return 0;
  }
  for (int i = 1; i <= M; i++) cout << i << " " << i * i * i + 10000000 << "\n";
  for (int i = M + 1; i <= N; i++)
    cout << i << " " << -(i * i * i + 10000000) << "\n";
  return 0;
}
