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;
const double pi = acos(-1.);
struct PointDouble {
  double x, y;
  PointDouble() : x(0), y(0) {}
  PointDouble(double x, double y) : x(x), y(y) {}
  PointDouble operator+(PointDouble P) { return PointDouble(x + P.x, y + P.y); }
  PointDouble operator-(PointDouble P) { return PointDouble(x - P.x, y - P.y); }
  PointDouble operator*(double c) { return PointDouble(x * c, y * c); }
  PointDouble rotate90() { return PointDouble(-y, x); }
  PointDouble rotate(double a) { return *this * cos(a) + rotate90() * sin(a); }
};
struct Point {
  int x, y;
  Point() : x(0), y(0) {}
  Point(int x, int y) : x(x), y(y) {}
  Point(PointDouble P) {
    x = (int)(P.x + 0.5);
    y = (int)(P.y + 0.5);
  }
  bool operator==(Point P) { return x == P.x && y == P.y; }
  bool operator!=(Point P) { return !(*this == P); }
  Point operator+(Point P) { return Point(x + P.x, y + P.y); }
  Point operator-(Point P) { return Point(x - P.x, y - P.y); }
  Point operator*(int c) { return Point(x * c, y * c); }
  long long operator*(Point P) { return x * 1LL * P.y - y * 1LL * P.x; }
};
Point ans33[3] = {Point(0, 0), Point(3, 0), Point(0, 3)};
Point ans34[4] = {Point(0, 0), Point(3, 0), Point(0, 3), Point(1, 1)};
Point ans35[5] = {Point(0, 0), Point(4, 0), Point(0, 4), Point(1, 1),
                  Point(1, 2)};
vector<Point> ans;
int n, m;
void printAns(vector<Point>& ans) {
  for (int i = 0; i < ans.size(); i++) printf("%d %d\n", ans[i].x, ans[i].y);
}
void printAns(Point* ans, int size) {
  for (int i = 0; i < size; i++) printf("%d %d\n", ans[i].x, ans[i].y);
}
bool checkLast() {
  Point P = ans.back();
  int size = ans.size();
  for (int i = 0; i < size - 1; i++) {
    Point A = ans[i];
    for (int j = i + 1; j < size - 1; j++) {
      Point B = ans[j];
      if ((A - P) * (B - P) == 0) return false;
    }
  }
  return true;
}
void shiftIfNeed() {
  if (checkLast()) return;
  Point S = ans.back();
  for (int shift = 1;; shift++) {
    for (int xShift = 0; xShift <= shift; xShift++) {
      int yShift = shift - xShift;
      for (int xs = -1; xs <= 1; xs += 2) {
        for (int ys = -1; ys <= 1; ys += 2) {
          ans.back() = Point(S.x + xs * xShift, S.y + ys * yShift);
          if (checkLast()) return;
        }
      }
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  if (m == 3) {
    if (n == 3)
      printAns(ans33, 3);
    else if (n == 4)
      printAns(ans34, 4);
    else
      printf("-1");
    return 0;
  }
  double angle = (pi * (m - 2)) / (m * 1.);
  double rotAngle = pi - angle;
  ans.push_back(Point(0, 0));
  PointDouble v = PointDouble((int)1e5, 0);
  for (int i = 1; i < m; i++) {
    ans.push_back(Point(PointDouble(ans.back().x, ans.back().y) + v));
    v = v.rotate(rotAngle);
    shiftIfNeed();
  }
  v = PointDouble(1e3, 0);
  v = v.rotate(angle / 2.);
  for (int i = 0; i < n - m; i++) {
    ans.push_back(Point(PointDouble(ans[i].x, ans[i].y) + v));
    if (i < m / 2)
      if (i % 2 == 0)
        ans.back().y -= 50;
      else
        ans.back().y += 50;
    else if (i % 2 == 0)
      ans.back().y += 50;
    else
      ans.back().y -= 50;
    v = v.rotate(rotAngle);
    shiftIfNeed();
  }
  printAns(ans);
  return 0;
}