#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3 && n > 4) {
    cout << "-1" << endl;
    return 0;
  }
  int cnt = 0, ans = 0;
  for (int i = 0; i < m; i++) printf("%d %d\n", i, ans += (cnt++));
  if (m < n) cout << m + 100000 << " " << ans << endl;
  for (int i = m + 1; i < n; i++) printf("%d %d\n", i + 100000, ans -= (--cnt));
  return 0;
}
