#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000100;
const int INF = 1e9 + 10;
int n, m;
int main() {
  while (cin >> n >> m) {
    if (m == 3 && n >= 5)
      puts("-1");
    else {
      for (int i = 1; i <= m; i++) printf("%d %d\n", i, i * i + maxn);
      for (int i = 1; i <= n - m; i++) printf("%d %d\n", i, -i * i - maxn);
    }
  }
  return 0;
}
