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 JAVA):

Solution:
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.io.Writer;
import java.math.BigInteger;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author ogiekako
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		MyScanner in = new MyScanner(inputStream);
		MyPrintWriter out = new MyPrintWriter(outputStream);
		TaskB solver = new TaskB();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskB {
    public void solve(int testNumber, MyScanner in, MyPrintWriter out) {
        int n = in.nextInt(), m = in.nextInt();
        if (m == 3) {
            if (n == 3) {
                String res = "0 0\n" +
                        "3 0\n" +
                        "0 3";
                out.println(res);
                return;
            } else if (n == 4) {
                String res = "0 0\n" +
                        "3 0\n" +
                        "0 3\n" +
                        "1 1";
                out.println(res);
                return;
            } else {
                out.println(-1);
                return;
            }
        } else if (m == 4) {
            int MAX = (int) 1e8 - 10;
            double t = 2 * Math.PI / 4;
            for (int i = 0; i < n; i++) {
                int x, y;
                if (i < m) {
                    x = (int) Math.round(Math.cos(t * i) * MAX);
                    y = (int) Math.round(Math.sin(t * i) * MAX);
                } else {
                    x = (int) Math.round(Math.cos(t * (i - m) + Math.PI / 100) * MAX / 2);
                    y = (int) Math.round(Math.sin(t * (i - m) + Math.PI / 100) * MAX / 2);
                }
                out.printFormat("%d %d\n", x, y);
            }
        } else {
            int MAX = (int) 1e8 - 10;
            double t = 2 * Math.PI / (m + 1 - m % 2);
            for (int i = 0; i < n; i++) {
                int x, y;
                if (i < m) {
                    x = (int) Math.round(Math.cos(t * i) * MAX);
                    y = (int) Math.round(Math.sin(t * i) * MAX);
                } else {
                    x = (int) Math.round(Math.cos(t * (i - m)) * MAX / 2);
                    y = (int) Math.round(Math.sin(t * (i - m)) * MAX / 2);
                }
                out.printFormat("%d %d\n", x, y);
            }
        }
    }
}

class MyScanner {
    private final InputStream in;

    public MyScanner(InputStream in) {
        this.in = in;
    }

    int bufLen;
    int bufPtr;
    byte[] buf = new byte[1024];

    public int read() {
        if (bufLen == -1)
            throw new InputMismatchException();
        if (bufPtr >= bufLen) {
            bufPtr = 0;
            try {
                bufLen = in.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (bufLen <= 0)
                return -1;
        }
        return buf[bufPtr++];
    }

    public int nextInt() {
        int c = read();
        if (c == -1) throw new NoSuchElementException();
        while (c != '-' && (c < '0' || '9' < c)) {
            c = read();
            if (c == -1) throw new NoSuchElementException();
        }
        if (c == '-') return -nextInt();
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while ('0' <= c && c <= '9');
        return res;
    }


    }

class MyPrintWriter {
    PrintWriter out;

    public MyPrintWriter(OutputStream outputStream) {
        out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public MyPrintWriter(Writer writer) {
        out = new PrintWriter(writer);
    }

    public void println(Object... os) {
        for (int i = 0; i < os.length - 1; i++) {
            out.print(os[i]);
            out.print(' ');
        }
        out.println(os[os.length - 1]);
    }

    public void close() {
        out.close();
    }

    public void printFormat(String format, Object... args) {
        out.printf(format,args);
    }

}