#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  cin >> n >> m;
  if (m == 3) {
    if (n == 3) {
      cout << "0 0" << endl << "1 0" << endl << "0 1" << endl;
    } else if (n == 4) {
      cout << "0 0" << endl
           << "1 -1" << endl
           << "-1 -1" << endl
           << "0 1" << endl;
    } else {
      cout << "-1" << endl;
    }
  } else {
    for (int i = 0; (i) < (m); i++)
      cout << i << " " << (10000000 + i * i) << endl;
    for (int i = 0; (i) < (n - m); i++)
      cout << i << " " << (-10000000 - i * i) << endl;
  }
  return 0;
}
