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.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

public class ProblemB {
	
	static long[][] memo;
	static int N;
	static int[] a;

	
	public static void main(String[] args) throws IOException {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int m = in.nextInt();
		if (n >= 5 && m == 3) {
			out.println(-1);
		} else {
			long time = System.currentTimeMillis();
			long[][] p = new long[n][2];
			if (m == 3) {
				p[0][0] = -50000000; p[0][1] = -50000000;
				p[1][0] = 50000000; p[1][1] = -50000000;
				p[2][0] = -50000000; p[2][1] = 50000000;
				if (n >= 4) {
					p[3][0] = p[0][0] + 1;
					p[3][1] = p[0][1] + 1;
				}
			} else {
				for (int i = 0 ; i < m ; i++) {
					long R = 90000000;
					double rad_per = 2 * Math.PI / m;
					double rad = rad_per * i;
					p[i][0] = (long)(R * Math.cos(rad));
					p[i][1] = (long)(R * Math.sin(rad));					
				}
				
				int tr = 0;
				while (System.currentTimeMillis() - time < 1500) {
					tr++;
					double dr = 0.01 + Math.random() * 0.01;
					for (int j = m ; j < n ; j++) {
						long R = 80000000;
						double rad_per = 2 * Math.PI / m;
						double rad = rad_per * (j - m) + dr;
						p[j][0] = (long)(R * Math.cos(rad));
						p[j][1] = (long)(R * Math.sin(rad));					
					}
					boolean isok = true;
					sch: for (int j = m ; j < n ; j++) {
						for (int k = m ; k < n ; k++) {
							for (int l = 0 ; l < n ; l++) {
								if (j == k || j == l || k == l) {
									continue;
								}
								long dx1 = p[j][0] - p[k][0];
								long dy1 = p[j][1] - p[k][1];
								long dx2 = p[j][0] - p[l][0];
								long dy2 = p[j][1] - p[l][1];
								if (dx1 * dy2 - dx2 * dy1 == 0) {
									isok = false;
									break sch;
								}
							}
						}
					}
					if (isok) {
						break;
					}
				}
			}
			for (int i = 0 ; i < n ; i++) {
				System.out.println(p[i][0] + " " + p[i][1]);
			}
		}
		out.flush();
	}
	

	public static void debug(Object... o) {
		System.err.println(Arrays.deepToString(o));
	}
}