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.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

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

class TaskB {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n=in.nextInt();
        int m=in.nextInt();
        if(m==3){
            if(n==3){
                out.println(0+" "+1);
                out.println(0+" "+2);
                out.println(1+" "+1);
                return;
            }
            if(n==4){
                out.println(0+" "+1);
                out.println(0+" "+3);
                out.println(1+" "+2);
                out.println(2+" "+2);
                return;
            }
            if(n>=5){
                out.println(-1);
                return;
            }
        }
        ArrayList<Pair<Integer,Integer>> Points=new ArrayList<Pair<Integer, Integer>>();
        int dy=100000;
        int dx=0;
        Points.add(new Pair<Integer, Integer>(-99999,0));
        int lasty=0;
        int lastx=-99999;
        int cx=1;
        for(int i=0;i<m-1;i++) {
            lasty+=dy;
            lastx-=cx;
            ++cx;
            Points.add(new Pair<Integer, Integer>(lastx,lasty));
        }
        for(int i=m;i<n;i++) {
            Pair<Integer,Integer> curPoint=Points.get(i-m);
            int curX=curPoint.first;
            int curY=curPoint.second;
            curX=Math.abs(curX);
            Points.add(new Pair<Integer, Integer>(curX,curY));
        }

        for(int i=0;i<n;i++) {
            out.println(Points.get(i).first+" "+Points.get(i).second);
        }

    }
}

class InputReader {
    StringTokenizer st;
    BufferedReader in;
    public InputReader(InputStream ins)
    {
        in = new BufferedReader(new InputStreamReader(ins));
    }

    public String nextToken()
    {
        while(st==null || !st.hasMoreTokens())
        {
            try {
                st=new StringTokenizer(in.readLine());
            } catch (IOException e) {
                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
            }
        }
        return st.nextToken();
    }
    public int nextInt()
    {

        return Integer.parseInt(nextToken());
    }

    }

class Pair<FIRST, SECOND> implements Comparable<Pair<FIRST, SECOND>> {

        public final FIRST first;
        public final SECOND second;

        public Pair(FIRST first, SECOND second) {
            this.first = first;
            this.second = second;
        }

        public int compareTo(Pair<FIRST, SECOND> o) {
            int cmp = compare(first, o.first);
            return cmp == 0 ? compare(second, o.second) : cmp;
        }

        private static int compare(Object o1, Object o2) {
            return o1 == null ? o2 == null ? 0 : -1 : o2 == null ? +1
                    : ((Comparable) o1).compareTo(o2);
        }

        public int hashCode() {
            return 31 * hashcode(first) + hashcode(second);
        }

       private static int hashcode(Object o) {
            return o == null ? 0 : o.hashCode();
        }

        public boolean equals(Object obj) {
            if (!(obj instanceof Pair))
                return false;
            if (this == obj)
                return true;
            return equal(first, ((Pair) obj).first)
                    && equal(second, ((Pair) obj).second);
        }
        private boolean equal(Object o1, Object o2) {
            return o1 == null ? o2 == null : (o1 == o2 || o1.equals(o2));
        }

}