#include <bits/stdc++.h>
using namespace std;
int n, m;
void solve() {
  if ((6 == n || 5 == n) && 3 == m) {
    puts("-1");
    return;
  }
  for (int i = 1; i <= m; ++i) {
    printf("%d %d\n", i, i * i);
  }
  for (int i = 1; i <= n - m; ++i) {
    printf("%d %d\n", -i, -i * i - 1000000);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  solve();
  return 0;
}
