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;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
struct point {
  double first, second;
  point(double first = 0, double second = 0) : first(first), second(second) {}
  point operator-(point a) { return point(first - a.first, second - a.second); }
  point operator+(point a) { return point(first + a.first, second + a.second); }
  point operator*(double a) { return point(first * a, second * a); }
  point operator/(double a) { return point(first / a, second / a); }
  point operator&(point a) {
    return point(first * a.first - second * a.second,
                 first * a.second + second * a.first);
  }
  point rotate(double al) { return *this & point(cos(al), sin(al)); }
  double operator^(point a) { return first * a.second - second * a.first; }
  double operator*(point a) { return first * a.first + second * a.second; }
  point norm() {
    double s = nor();
    if (s < 1e-7) return *this;
    return point(first / s, second / s);
  }
  point conj() { return point(-second, first); }
  double nor() { return sqrt(*this * *this); }
  double al() { return atan2(second, first); }
  bool operator<(const point &a) const {
    if (fabs(first - a.first) > 1e-7) return first < a.first;
    return second < a.second - 1e-7;
  }
  bool operator>(const point &a) const {
    if (fabs(first - a.first) > 1e-7) return first > a.first;
    return second > a.second + 1e-7;
  }
  bool operator==(const point &a) const {
    if (fabs(first - a.first) > 1e-7) return 0;
    return fabs(second - a.second) < 1e-7;
  }
  bool operator!=(const point &a) const {
    if (*this == a) return false;
    return true;
  }
  void input() { scanf("%lf %lf", &first, &second); }
  void print() { printf("%d %d\n", (int)first, (int)second); }
};
int sgn(double a) { return (a > 1e-7) - (a < -1e-7); }
bool is_on(point a, point b, point c) {
  if (sgn(a - b ^ b - c)) return 0;
  return sgn((a - c) * (b - c)) <= 0;
}
double pi = acos(-1);
point p[310];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  if (m == 3) {
    if (n == 3) {
      puts("0 0");
      puts("0 1");
      puts("1 0");
    } else if (n == 4) {
      puts("0 0");
      puts("3 0");
      puts("0 3");
      puts("1 1");
    } else
      puts("-1");
    return 0;
  }
  if (m == 4) {
    if (n == 4) {
      puts("0 0");
      puts("1 0");
      puts("0 1");
      puts("1 1");
    } else if (n == 5) {
      puts("0 0");
      puts("4 0");
      puts("0 4");
      puts("4 4");
      puts("3 2");
    } else if (n == 6) {
      puts("0 0");
      puts("10 0");
      puts("0 10");
      puts("10 10");
      puts("1 5");
      puts("9 5");
    } else if (n == 7) {
      puts("176166 6377");
      puts("709276 539564");
      puts("654734 174109");
      puts("910147 434207");
      puts("790497 366519");
      puts("606663 21061");
      puts("859328 886001");
    } else if (n == 8) {
      puts("0 0");
      puts("100000 0");
      puts("0 100000");
      puts("100000 100000");
      puts("1000000 -1");
      puts("1000000 100001");
      puts("-1000000 -1");
      puts("-1000000 100001");
    } else
      puts("-1");
    return 0;
  }
  double al = 2 * pi / m;
  p[0] = point(674311., 177527.);
  for (int i = 1; i < 310; i++) p[i] = p[i - 1].rotate(al);
  if (n & 1) {
    for (int i = 0; i < n - m; i++) ((p[i] + p[i + 1] + p[i + 2]) / 3).print();
    for (int i = 1; i <= m; i++) p[i].print();
  } else {
    for (int i = 1; i <= m / 2; i++) p[i].first++;
    for (int i = 1; i <= m; i++) p[i].print();
    for (int i = 0; i < n - m; i++) ((p[i] + p[i + 1] + p[i + 2]) / 3).print();
  }
}