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