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.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        new Solution().run();
    }
}



final class Solution implements Runnable {

    final static class Nim {
        public int index;
        public long g;
        public int cnt;
        public int lineType;

        public Nim(int index, int cnt, long g, int lineType) {
            this.index = index;
            this.cnt = cnt;
            this.g = g;
            this.lineType = lineType;
        }

        public long getGrungy() {
            if (cnt % 2 == 0)
                return 0;
            else
                return g;
        }
    }

    final static class Event implements Comparable<Event> {
        public int pos;
        public int delta;

        public Event(int pos, int delta) {
            this.pos = pos;
            this.delta = delta;
        }

        @Override
        public int compareTo(Event o) {
            return pos - o.pos;
        }
    }

    double INF = 1e10;
    int OFFSET = 5000;

    int solve() throws Throwable {

        int n = in.nextInt();
        int m = in.nextInt();

        if (m == 3 && n >= 5) {
            out.println(-1);
            return 0;
        }

        int h = 1000000;

        for (int i = 0; i < m; i++) {
            out.printf("%d %d\n", i, h + i * i);
        }

        for (int i = 0; i < n - m; i++) {
            out.printf("%d %d\n", i, -h -i * i);
        }

        /*
        int k = in.nextInt();

        HashMap<Integer, ArrayList<Event>>[] events = new HashMap[2];
        for (int i = 0; i < events.length; i++)
            events[i] = new HashMap<>();

        for (int i = 0; i < k; i++) {
            int xb = in.nextInt();
            int yb = in.nextInt();
            int xe = in.nextInt();
            int ye = in.nextInt();
            if (xb == xe) {
                if (events[0].get(xb) == null)
                    events[0].put(xb, new ArrayList<>());
                if (yb > ye) {
                    int tmp = yb;
                    yb = ye;
                    ye = tmp;
                }
                ArrayList<Event> curX = events[0].get(xb);
                curX.add(new Event(yb, 1));
                curX.add(new Event(ye, -1));
            } else {
                if (events[1].get(yb) == null)
                    events[1].put(yb, new ArrayList<>());
                if (xb > xe) {
                    int tmp = xb;
                    xb = xe;
                    xe = tmp;
                }
                ArrayList<Event> curY = events[1].get(yb);
                curY.add(new Event(xb, 1));
                curY.add(new Event(xe, -1));

            }
        }

        HashMap<Integer, Integer>[] batchSizes = new HashMap[2];
        for (int i = 0; i < batchSizes.length; i++)
            batchSizes[i] = new HashMap<>();

        for (int eventType = 0; eventType < events.length; eventType++) {
            HashMap<Integer, ArrayList<Event>> curMap = events[eventType];
            for (Map.Entry<Integer, ArrayList<Event>> kv : curMap.entrySet()) {
                ArrayList<Event> curEvents = kv.getValue();
                Collections.sort(curEvents);
                int totalLen = eventType == 0 ? m : n;
                int openedCount = 0;
                Event prev = null;
                for (int i = 0; i < curEvents.size(); i++) {
                    Event cur = curEvents.get(i);
                    if (openedCount != 0) {
                        totalLen -= (cur.pos - prev.pos);
                    }
                    openedCount += cur.delta;
                    prev = cur;
                }
                batchSizes[eventType].put(kv.getKey(), totalLen);
            }
        }

        ArrayList<Nim> nims = new ArrayList<>();
        nims.add(new Nim(-1, n - batchSizes[0].size() - 1, m, 0));
        nims.add(new Nim(-1, m - batchSizes[1].size() - 1, n, 1));
        for (int lineType = 0; lineType < batchSizes.length; lineType++) {
            for (Map.Entry<Integer, Integer> entry : batchSizes[lineType].entrySet())
                nims.add(new Nim(entry.getKey(), 1, entry.getValue(), lineType));
        }

        long grundy = 0;
        for (int i = 0; i < nims.size(); i++)
            grundy ^= nims.get(i).getGrungy();

        if (grundy == 0)
            out.print("SECOND");
        else {
            out.print("FIRST");
            for (int i = 0; i < nims.size(); i++)
        }
          */
        return 0;
    }


    FastScanner in;
    PrintWriter out;

    @Override
    public void run() {
        try {
            boolean ONLINE_JUDGE = false;
            try {
                Locale.setDefault(Locale.US);
                ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
            } catch (SecurityException e) {
                System.err.println("Operation forbidden");
            }


            long time = System.currentTimeMillis();
            if (ONLINE_JUDGE) {
                in = new FastScanner(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new FastScanner(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }

            int ret = solve();
            out.close();
            in.close();

            long delta = System.currentTimeMillis() - time;

            long freeMem = Runtime.getRuntime().freeMemory();
            long totalMem = Runtime.getRuntime().totalMemory();

            System.err.printf("Time: %.3f s\n", delta / 1000.0f);
            System.err.printf("Memory: %.3f MB\n", (float)(totalMem - freeMem) / (1 << 20));

            if (ret != 0)
                System.exit(ret);

        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}

@SuppressWarnings("unused")
final class FastScanner {
    BufferedReader bufferedReader;
    StringTokenizer stringTokenizer;

    public FastScanner(Reader r) {
        bufferedReader = new BufferedReader(r);
    }

    public String nextToken() throws IOException, NullPointerException {
        while (stringTokenizer == null || !stringTokenizer.hasMoreTokens())
            stringTokenizer = new StringTokenizer(bufferedReader.readLine());
        return stringTokenizer.nextToken();
    }

    public String nextLine() throws IOException {
        return bufferedReader.readLine();
    }

    public int nextInt() throws IOException, NullPointerException {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public BigInteger nextBigInteger() throws IOException {
        return new BigInteger(nextToken());
    }

    public float nextFloat() throws IOException {
        return Float.parseFloat(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public int read() throws IOException {
        return bufferedReader.read();
    }

    public void close() throws IOException {
        bufferedReader.close();
    }

    public int[] readIntArray(int n) throws Throwable {
        int[] array = new int[n];
        for (int i = 0; i < n; i++)
            array[i] = nextInt();
        return array;
    }

    @Override
    protected void finalize() throws Throwable {
        super.finalize();
        close();
    }
}

final class DisjointSetUnion {
    int[] parent;
    int[] rank;

    public DisjointSetUnion(int size) {
        parent = new int[size];
        rank = new int[size];
        for (int i = 0; i < size; i++)
            parent[i] = i;
    }

    public int getLeader(int element) {
        if (parent[element] == element)
            return element;
        else
            return parent[element] = getLeader(parent[element]);
    }

    public boolean union(int x, int y) {
        x = getLeader(x);
        y = getLeader(y);
        if (x == y)
            return true;
        if (rank[x] < rank[y]) {
            int temp = x;
            x = y;
            y = temp;
        }
        parent[y] = x;
        if (rank[x] == rank[y])
            ++rank[x];
        return false;
    }
}




@SuppressWarnings("unused")
final class Utils {
    private Utils() {}

    final static int INF_I = Integer.MAX_VALUE;
    final static double INF_D = Double.POSITIVE_INFINITY;
    final static long INF_L = Long.MAX_VALUE;


    public static int[] solveAssignmentProblem(double[][] a) {
        int n = a.length - 1;
        int m = a[0].length - 1;
        double[] u = new double[n + 1], v = new double[m + 1], minv = new double[m + 1];
        boolean[] used = new boolean[m + 1];
        int[] p = new int[m + 1], prev = new int[m + 1];
        for (int i = 1; i <= n; i++) {
            Arrays.fill(used, false);
            Arrays.fill(minv, INF_D);
            int j0 = 0;
            p[j0] = i;
            do {
                int i0 = p[j0];
                used[j0] = true;
                double delta = INF_D;
                int j1 = 0;
                for (int j = 1; j <= m; j++) {
                    if (!used[j]) {
                        double cur = a[i0][j] + u[i0] + v[j];
                        if (cur < minv[j]) {
                            minv[j] = cur;
                            prev[j] = j0;
                        }
                        if (minv[j] < delta) {
                            delta = minv[j];
                            j1 = j;
                        }
                    }
                }
                for (int j = 0; j <= m; j++) {
                    if (used[j]) {
                        u[p[j]] -= delta;
                        v[j]  += delta;
                    } else
                        minv[j] -= delta;
                }
                j0 = j1;
            } while (p[j0] != 0);
            do {
                int j1 = prev[j0];
                p[j0] = p[j1];
                j0 = j1;
            } while (j0 != 0);

        }
        return p;
    }


    //a - 1 indexed
    public static int[] hungarian(int[][] a) {
        int n = a.length - 1;
        int m = a[0].length - 1;
        int[] prev = new int[m + 1];
        int[] u = new int[n + 1];
        int[] v = new int[m + 1];
        boolean[] used = new boolean[m + 1];
        int[] p = new int[m + 1];
        int[] minv = new int[m + 1];
        for (int i = 1; i <= n; i++) {
            Arrays.fill(used, false);
            Arrays.fill(minv, INF_I);
            int j0 = 0;
            p[j0] = i;
            do {
                used[j0] = true;
                int i0 = p[j0];
                int delta = INF_I;
                int j1 = 0;
                for (int j = 1; j <= m; j++) {
                    if (!used[j]) {
                        int cur = a[i0][j] + u[i0] + v[j];
                        if (cur < minv[j]) {
                            minv[j] = cur;
                            prev[j] = j0;
                        }
                        if (minv[j] < delta) {
                            j1 = j;
                            delta = minv[j];
                        }
                    }
                }
                for (int j = 0; j <= m; j++) {
                    if (used[j]) {
                        u[p[j]] -= delta;
                        v[j] += delta;
                    } else
                        minv[j] -= delta;
                }
                j0 = j1;
            } while (p[j0] != 0);
            do {
                int j1 = prev[j0];
                p[j0] = p[j1];
                j0 = j1;
            } while (j0 != 0);
        }
        return p;
    }


    //a - 1 indexed


    public static int[] hungarian(long[][] a) {
        int n = a.length - 1;
        int m = a[0].length - 1;
        int[] prev = new int[m + 1];
        long[] u = new long[n + 1];
        long[] v = new long[m + 1];
        boolean[] used = new boolean[m + 1];
        int[] p = new int[m + 1];
        long[] minv = new long[m + 1];
        for (int i = 1; i <= n; i++) {
            Arrays.fill(used, false);
            Arrays.fill(minv, INF_L);
            int j0 = 0;
            p[j0] = i;
            do {
                used[j0] = true;
                int i0 = p[j0];
                long delta = INF_L;
                int j1 = 0;
                for (int j = 1; j <= m; j++) {
                    if (!used[j]) {
                        long cur = a[i0][j] + u[i0] + v[j];
                        if (cur < minv[j]) {
                            minv[j] = cur;
                            prev[j] = j0;
                        }
                        if (minv[j] < delta) {
                            j1 = j;
                            delta = minv[j];
                        }
                    }
                }
                for (int j = 0; j <= m; j++) {
                    if (used[j]) {
                        u[p[j]] -= delta;
                        v[j] += delta;
                    } else
                        minv[j] -= delta;
                }
                j0 = j1;
            } while (p[j0] != 0);
            do {
                int j1 = prev[j0];
                p[j0] = p[j1];
                j0 = j1;
            } while (j0 != 0);
        }
        return p;
    }

    public static long sqr(long x) {
        return x * x;
    }

    public static int gcd(int x, int y) {
        while (y > 0) {
            x %= y;
            int temp = x;
            x = y;
            y = temp;
        }
        return x;
    }

    public static int lcm(int x, int y) {
        return x / gcd(x, y) * y;
    }

    public static long gcd(long x, long y) {
        while (y > 0) {
            x %= y;
            long temp = x;
            x = y;
            y = temp;
        }
        return x;
    }

    public static long lcm(long x, long y) {
        return x / gcd(x, y) * y;
    }

    public static long modInverse(long x, long mod) {
        return BigInteger.valueOf(x).modInverse(BigInteger.valueOf(mod)).longValue();
    }

    static Random r = new Random(System.nanoTime());

    public static<T> void shuffle(T[] array) {
        int n = array.length;
        for (int i = 0; i < n; i++) {
            int j = r.nextInt(n);
            T t = array[i];
            array[i] = array[j];
            array[j] = t;
        }
    }

    public static void shuffle(int[] array) {
        int n = array.length;
        for (int i = 0; i < n; i++) {
            int j = r.nextInt(n);
            int t = array[i];
            array[i] = array[j];
            array[j] = t;
        }
    }
}