#include <bits/stdc++.h>
using namespace std;
int n, m;
int x[300], y[300];
int main() {
  cin >> n >> m;
  if (m == 3 && n >= 5) {
    cout << -1 << endl;
    return 0;
  }
  double alph = acos(-1.) / m;
  for (int i = 0; i < m; i++) {
    x[m + i] = 900000 * cos(alph * i);
    x[i] = x[m + i];
    y[m + i] = 900000 * sin(alph * i) - 10000000;
    y[i] = -y[m + i];
  }
  for (int i = 0; i < n; i++) cout << x[i] << ' ' << y[i] << endl;
  return 0;
}
