#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
int main() {
  int n, m;
  cin >> n >> m;
  if (m == 3 && n >= 5) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < (int)m; i++) {
    cout << i << " " << i * i << endl;
  }
  for (int i = 0; i < (int)n - m; i++) {
    cout << i << " " << -i * i - 1000000 << endl;
  }
  return 0;
}
