#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n, m;
  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\n";
    return 0;
  }
  for (int i = 0; i < m; i++) cout << i << ' ' << int(1e7) + i * i << '\n';
  for (int i = 0; i < n - m; i++) cout << i << ' ' << -int(1e7) - i * i << '\n';
}
