#include <bits/stdc++.h>
using namespace std;
double R = 10000000.0, r = 9999000.0, PI = 2 * acos(0), da = PI / 20000000.0;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3 && n > 4)
    cout << "-1";
  else {
    for (int i = 0; i < m; i++) {
      cout << int(R * sin(PI * 2.0 * (double(i) / double(m)))) << ' ';
      cout << int(R * cos(PI * 2.0 * (double(i) / double(m)))) << '\n';
    }
    for (int i = 0; i < n - m; i++) {
      cout << int(r * sin(PI * 2.0 * (double(i) / double(m)) + da)) << ' ';
      cout << int(r * cos(PI * 2.0 * (double(i) / double(m)) + da)) << '\n';
    }
  }
  return 0;
}
