#include <bits/stdc++.h>
using namespace std;
int n, m;
double pi = atan(1) * 4;
int main() {
  int w1 = 0;
  int w2 = -1;
  cin >> n >> m;
  if ((m == 3) and (n > 4)) {
    cout << -1 << endl;
    return 0;
  }
  long long rad1 = 100000 * n;
  long long rad2 = 900 * n;
  for (int i = 0; i < m; i++) {
    long long x = (long long)(rad1 * (sin(i * 1.0 / m * 2 * pi)));
    long long y = (long long)(rad1 * (cos(i * 1.0 / m * 2 * pi)));
    cout << x << " " << y << endl;
  }
  for (int i = 0; i < n - m; i++) {
    long long x = (long long)(rad2 * (sin(i * 1.0 / m * 2 * pi + 0.1)));
    long long y = (long long)(rad2 * (cos(i * 1.0 / m * 2 * pi + 0.1)));
    cout << x << " " << y << endl;
  }
  return 0;
}
