Problem: Convexity of a set of points on the plane is the size of the largest subset of points that form a convex polygon. Your task is to build a set of n points with the convexity of exactly m. Your set of points should not contain three points that lie on a straight line.

Input

The single line contains two integers n and m (3 ≤ m ≤ 100, m ≤ n ≤ 2m).

Output

If there is no solution, print "-1". Otherwise, print n pairs of integers — the coordinates of points of any set with the convexity of m. The coordinates shouldn't exceed 108 in their absolute value.

Examples

Input

4 3


Output

0 0
3 0
0 3
1 1


Input

6 3


Output

-1


Input

6 6


Output

10 0
-10 0
10 1
9 1
9 -1
0 -2


Input

7 4


Output

176166 6377
709276 539564
654734 174109
910147 434207
790497 366519
606663 21061
859328 886001

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n, m;
int i, j, k, l;
struct point {
  long long x, y;
  point(long long X = 0, long long Y = 0) {
    x = X;
    y = Y;
  }
  double dist(point &p) {
    return sqrt(0. + ((p.x - x) * (p.x - x)) + ((p.y - y) * (p.y - y)));
  }
};
bool operator<(const point &p, const point &q) {
  return p.x < q.x || p.x == q.x && p.y < q.y;
}
long long vp(point &a, point &b, point &c) {
  return (a.x - c.x) * (b.y - c.y) - (a.y - c.y) * (b.x - c.x);
}
vector<point> v;
void ans(int e = 0) {
  if (e)
    cout << e << endl;
  else {
    for (typeof((v).begin()) it = (v).begin(); it != (v).end(); it++)
      cout << it->x << ' ' << it->y << endl;
  }
  exit(0);
}
bool check(vector<point> &p) {
  for (int i = 0; i < p.size(); ++i)
    for (int j = i + 1; j < p.size(); ++j)
      for (int k = j + 1; k < p.size(); ++k)
        if (vp(p[i], p[j], p[k]) == 0) {
          return false;
        }
  return true;
}
void so() {
  srand(time(0));
  long long R2 = 10000;
  long long R1 = 5000;
  if (m == 3) {
    v.push_back(point(0, 0));
    v.push_back(point(1, 2));
    v.push_back(point(2, 0));
    if (n >= 4) v.push_back(point(1, 3));
    if (n == 5) ans(-1);
    if (n == 6) ans(-1);
    ans();
  } else if (m == 4) {
    v.push_back(point(0, 0));
    v.push_back(point(7, 0));
    v.push_back(point(5, 2));
    v.push_back(point(2, 3));
    if (n >= 5) v.push_back(point(2, 7));
    if (n >= 6) v.push_back(point(6, 3));
    if (n >= 7) v.push_back(point(15, -1));
    if (n >= 8) v.push_back(point(-1, -1));
    while (!check(v))
      ;
    ans();
  }
  int d = ((m - 3) / 4 + 1) * 2 + 1;
  bool fl = d * 2 - 2 >= m;
  long long yh = d / 2;
  yh *= yh;
  if (!fl) yh += 2;
  for (int x = -d / 2; x <= d / 2; ++x) {
    if (x == 0 && m % 2 == 1)
      ;
    else
      v.push_back(point(x, x * x - yh));
  }
  for (int x = d / 2 - fl; x >= -d / 2 + fl; --x) {
    v.push_back(point(x, yh - x * x));
  }
  for (;;) {
    vector<point> p = v;
    double u = ((rand() << 15 ^ rand()) % (100000)) / 1e6;
    int tn = n - m;
    for (i = 0; i < m && tn; ++i) {
      point q = point(v[i].x * (i % 2 ? R1 : R2), v[i].y * (i % 2 ? R1 : R2));
      q = point(q.x * cos(u) - q.y * sin(u), q.x * sin(u) + q.y * cos(u));
      p.push_back(q);
      --tn;
    }
    if (check(p)) {
      v = p;
      break;
    }
  }
  if (v.size() != n) ++*(int *)0;
  ans();
}
int main() {
  cin >> n >> m;
  so();
  return 0;
}