#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3) {
    if (n == 3) {
      cout << 0 << " " << 0 << '\n';
      cout << 0 << " " << 1 << '\n';
      cout << 1 << " " << 0 << '\n';
      return 0;
    }
    if (n == 4) {
      cout << 0 << " " << 0 << '\n';
      cout << 0 << " " << 5 << '\n';
      cout << 5 << " " << 0 << '\n';
      cout << 1 << " " << 1 << '\n';
      return 0;
    }
    cout << "-1\n";
    return 0;
  }
  int X = 1e7;
  for (long long i = 0; i < m; i++) cout << i << " " << X + i * i << '\n';
  for (long long i = 0; i < n - m; i++) cout << i << " " << -X - i * i << '\n';
  return 0;
}
