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.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
//    
//    List<List<Integer>> gr;
//    boolean visited[];
    
//    private void solve() throws IOException {
//        int n = nextInt();
//        int m = nextInt();
//        gr = new ArrayList<>(n + m);
//        for (int i = 0; i < n + m; ++i)
//            gr.add(new ArrayList<Integer>(Math.max(m, n)));
//        
//        visited = new boolean[n + m];
//        for (int i = 0; i < n; ++i) {
//            int k = nextInt();
//            for (int j = 0; j < k; ++j) {
//                int lang = nextInt() - 1;
//                gr.get(n + lang).add(i);
//                gr.get(i).add(n + lang);
//            }
//        }
//        
//        int res = -1;
//        for (int i = 0 ; i < n; ++i) {
//            if (!visited[i]) {
//                dfs(i);
//                ++res;
//            }
//        }
//        
//        println(res);
//    }
//    
//    private void dfs(int v) {
//        visited[v] = true;
//        for (Integer u : gr.get(v)) {
//            if (!visited[u])
//                dfs(u);
//        }
//    }
//    
    
    private void solve() throws IOException {
        int n = nextInt();
        int m = nextInt();
        
        if (n > 4 && m == 3) {
            println(-1);
            return;
        }
        
        if (n == 4 && m == 3) {
            println("0 0");
            println("3 0");
            println("0 3");
            println("1 1");
            return;
        }
        
        if (n == 3 && m == 3) {
            println("0 0");
            println("3 0");
            println("0 3");
            return;
        }
        
        int x[] = new int[2*m];
        int y[] = new int[2*m];
        
        int i = 0, a = 0, b = 0, db = 1;
        while (i < m && i < n) {
            x[i] = a;
            y[i] = b;
            ++a;
            b += db;
            ++db;
            ++i;
        }
        
        a = 300; b = 0; db = -1;
        while (i < n) {
            x[i] = a;
            y[i] = b;
            --a;
            b += db;
            --db;
            ++i;
        }
        
        for (i = 0; i < n; ++i) {
            println(x[i] + " " + y[i]);
        }
    }
    
    public static void main(String[] args) {
        new Main().run();
    }

    public void run() {
        try {
            if (isFileIO) {
                pw = new PrintWriter(new File("output.out"));
                br = new BufferedReader(new FileReader("input.in"));
            } else {
                pw = new PrintWriter(System.out);
                br = new BufferedReader(new InputStreamReader(System.in));
            }
            solve();
            pw.close();
            br.close();
        } catch (IOException e) {
            System.err.println("IO Error");
        }
    }

    private void print(Object o) {
        pw.print(o);
    }

    private void println(Object o) {
        pw.println(o);
    }

    private void println() {
        pw.println();
    }

    int[] nextIntArray(int n) throws IOException {
        int arr[] = new int[n];
        for (int i = 0; i < n; ++i)
            arr[i] = Integer.parseInt(nextToken());
        return arr;
    }

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

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

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

    private String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(br.readLine());
        }

        return tokenizer.nextToken();
    }

    private BufferedReader br;
    private StringTokenizer tokenizer;
    private PrintWriter pw;
    private final boolean isFileIO = false;
}