#include <bits/stdc++.h>
using namespace std;
int N, M;
int main() {
  scanf("%d %d", &N, &M);
  if (M == 3 && N > 4) {
    printf("-1\n");
    return 0;
  }
  for (int x = 0; x < M; ++x) printf("%d %d\n", x, x * x);
  for (int x = 0; x < N - M; ++x) printf("%d %d\n", 2 * M - x, -x * x);
  return 0;
}
