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.
The single line contains two integers *n* and *m* (3 ≤ *m* ≤ 100, *m* ≤ *n* ≤ 2*m*).
from sys import stdin,stdout
input = stdin.readline

def main():
    #t = int(input())
    t = 1
    for z in range(t):
        #n = int(input())
        #a,b,c = map(int,input().split())
        #ai = list(map(int,input().split()))
        n,m = map(int,input().split())
        if m == 3 and n == 6:
            print(0)
        if m == 3:
            print(-10**7,-10**7+9)
            print(-10**7,10**7-12)
            print(10**6, 0)
            for i in range(2,2+n-3):
                print(-i, - (i**2))
        else:
            print(-10**7,-10**7+9)
            print(-10**7,10**7-12)
            print(10**7,10**7-12)
            print(-10**7,10**7+103)
            i2 = 2
            for i in range(m-4):
                print(10**7-i*2,10**7-12-i2)
                i2 -= i
            for i in range(2,2+n-m):
                print(-i, - (i**2))
            
main()
