import math
n=int(input())

def add_v(l1,l2):
    n=len(l1)
    l=[0]*n
    for i in range(n):
        l[i]=l1[i]+l2[i]
    return l

def scar_multiple_v(scalar,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        ans[i]=l[i]*scalar
    return ans

def mat_multi_v(mat,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
    return ans

def make_points(tail,head):
    ans=[[0]*2 for _ in range(5)]
    ans[0]=tuple(tail)
    ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))))

    v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))
    mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]]
    ans[2]=tuple(add_v(tail,mat_multi_v(mat,v)))
    ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))))
    ans[4]=tuple(head)
    return tuple(ans)

def make_1_coch_curve(iter,tail,head):
    points=make_points(tail,head)
    if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
            
if n == 0:
    print("{} {}\n{} {}".format(0,0,100,0))
else:
    make_1_coch_curve(0,[0,0],[100,0])
    print("{} {}".format(100,0))
        
 import math math n=int(input()) n int(input()) int input() input def add_v(l1,l2):
    n=len(l1)
    l=[0]*n
    for i in range(n):
        l[i]=l1[i]+l2[i]
    return l add_v n=len(l1) n len(l1) len l1 l=[0]*n l [0]*n [0] 0 n for i in range(n):
        l[i]=l1[i]+l2[i]
     i range(n) range n l[i]=l1[i]+l2[i] l[i] l i l1[i]+l2[i] l1[i] l1 i l2[i] l2 i return l l l1 l1 l2 l2 def scar_multiple_v(scalar,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        ans[i]=l[i]*scalar
    return ans scar_multiple_v n=len(l) n len(l) len l ans=[0]*n ans [0]*n [0] 0 n for i in range(n):
        ans[i]=l[i]*scalar
     i range(n) range n ans[i]=l[i]*scalar ans[i] ans i l[i]*scalar l[i] l i scalar return ans ans scalar scalar l l def mat_multi_v(mat,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
    return ans mat_multi_v n=len(l) n len(l) len l ans=[0]*n ans [0]*n [0] 0 n for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
     i range(n) range n for j in range(n):
            ans[i]+=mat[i][j]*l[j]
     j range(n) range n ans[i]+=mat[i][j]*l[j] ans[i] ans i mat[i][j]*l[j] mat[i][j] [i] mat i j l[j] l j return ans ans mat mat l l def make_points(tail,head):
    ans=[[0]*2 for _ in range(5)]
    ans[0]=tuple(tail)
    ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))))

    v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))
    mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]]
    ans[2]=tuple(add_v(tail,mat_multi_v(mat,v)))
    ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))))
    ans[4]=tuple(head)
    return tuple(ans) make_points [0]*2 for _ in range(5) for _ in range(5) _ range(5) range 5 for _ in range(5) [0]*2 [0] 0 2 ans=[[0]*2 for _ in range(5)] ans [[0]*2 for _ in range(5)] ans[0]=tuple(tail) ans[0] ans 0 tuple(tail) tuple tail ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail))))) ans[1] ans 1 tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail))))) tuple add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))) add_v tail scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail))) scar_multiple_v 1/3 1 3 add_v(head,scar_multiple_v(-1,tail)) add_v head scar_multiple_v(-1,tail) scar_multiple_v -1 tail v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail))) v scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail))) scar_multiple_v 1/3 1 3 add_v(head,scar_multiple_v(-1,tail)) add_v head scar_multiple_v(-1,tail) scar_multiple_v -1 tail mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]] mat [[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]] [1+math.cos(math.radians(60)),-math.sin(math.radians(60))] 1+math.cos(math.radians(60)) 1 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 -math.sin(math.radians(60)) math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))] math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 1+math.cos(math.radians(60)) 1 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 ans[2]=tuple(add_v(tail,mat_multi_v(mat,v))) ans[2] ans 2 tuple(add_v(tail,mat_multi_v(mat,v))) tuple add_v(tail,mat_multi_v(mat,v)) add_v tail mat_multi_v(mat,v) mat_multi_v mat v ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail))))) ans[3] ans 3 tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail))))) tuple add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))) add_v tail scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail))) scar_multiple_v 2/3 2 3 add_v(head,scar_multiple_v(-1,tail)) add_v head scar_multiple_v(-1,tail) scar_multiple_v -1 tail ans[4]=tuple(head) ans[4] ans 4 tuple(head) tuple head return tuple(ans) tuple(ans) tuple ans tail tail head head def make_1_coch_curve(iter,tail,head):
    points=make_points(tail,head)
    if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
             make_1_coch_curve points=make_points(tail,head) points make_points(tail,head) make_points tail head if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
             iter == n-1 iter n-1 n 1 for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
     i range(len(points)-1) range len(points)-1 len(points) len points 1 print("{} {}".format(points[i][0],points[i][1])) print "{} {}".format(points[i][0],points[i][1]) "{} {}".format "{} {}" format points[i][0] [i] points i 0 points[i][1] [i] points i 1 for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
             i range(4) range 4 make_1_coch_curve(iter+1,points[i],points[i+1]) make_1_coch_curve iter+1 iter 1 points[i] points i points[i+1] points i+1 i 1 iter iter tail tail head head if n == 0:
    print("{} {}\n{} {}".format(0,0,100,0))
else:
    make_1_coch_curve(0,[0,0],[100,0])
    print("{} {}".format(100,0))
         n == 0 n 0 print("{} {}\n{} {}".format(0,0,100,0)) print "{} {}\n{} {}".format(0,0,100,0) "{} {}\n{} {}".format "{} {}\n{} {}" format 0 0 100 0 make_1_coch_curve(0,[0,0],[100,0]) make_1_coch_curve 0 [0,0] 0 0 [100,0] 100 0 print("{} {}".format(100,0)) print "{} {}".format(100,0) "{} {}".format "{} {}" format 100 0 def make_1_coch_curve(iter,tail,head):
    points=make_points(tail,head)
    if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
             def make_1_coch_curve(iter,tail,head):
    points=make_points(tail,head)
    if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
             make_1_coch_curve def add_v(l1,l2):
    n=len(l1)
    l=[0]*n
    for i in range(n):
        l[i]=l1[i]+l2[i]
    return l def add_v(l1,l2):
    n=len(l1)
    l=[0]*n
    for i in range(n):
        l[i]=l1[i]+l2[i]
    return l add_v def scar_multiple_v(scalar,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        ans[i]=l[i]*scalar
    return ans def scar_multiple_v(scalar,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        ans[i]=l[i]*scalar
    return ans scar_multiple_v def make_points(tail,head):
    ans=[[0]*2 for _ in range(5)]
    ans[0]=tuple(tail)
    ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))))

    v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))
    mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]]
    ans[2]=tuple(add_v(tail,mat_multi_v(mat,v)))
    ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))))
    ans[4]=tuple(head)
    return tuple(ans) def make_points(tail,head):
    ans=[[0]*2 for _ in range(5)]
    ans[0]=tuple(tail)
    ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))))

    v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))
    mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]]
    ans[2]=tuple(add_v(tail,mat_multi_v(mat,v)))
    ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))))
    ans[4]=tuple(head)
    return tuple(ans) make_points def mat_multi_v(mat,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
    return ans def mat_multi_v(mat,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
    return ans mat_multi_v n=int(input()) int(input()) n
import math
n=int(input())

def add_v(l1,l2):
    n=len(l1)
    l=[0]*n
    for i in range(n):
        l[i]=l1[i]+l2[i]
    return l

def scar_multiple_v(scalar,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        ans[i]=l[i]*scalar
    return ans

def mat_multi_v(mat,l):
    n=len(l)
    ans=[0]*n
    for i in range(n):
        for j in range(n):
            ans[i]+=mat[i][j]*l[j]
    return ans

def make_points(tail,head):
    ans=[[0]*2 for _ in range(5)]
    ans[0]=tuple(tail)
    ans[1]=tuple(add_v(tail,scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))))

    v=scar_multiple_v(1/3,add_v(head,scar_multiple_v(-1,tail)))
    mat=[[1+math.cos(math.radians(60)),-math.sin(math.radians(60))],\
         [math.sin(math.radians(60))  ,1+math.cos(math.radians(60))]]
    ans[2]=tuple(add_v(tail,mat_multi_v(mat,v)))
    ans[3]=tuple(add_v(tail,scar_multiple_v(2/3,add_v(head,scar_multiple_v(-1,tail)))))
    ans[4]=tuple(head)
    return tuple(ans)

def make_1_coch_curve(iter,tail,head):
    points=make_points(tail,head)
    if iter == n-1:
        for i in range(len(points)-1):
            print("{} {}".format(points[i][0],points[i][1]))
            
    else:
        for i in range(4):
            make_1_coch_curve(iter+1,points[i],points[i+1])
            
if n == 0:
    print("{} {}\n{} {}".format(0,0,100,0))
else:
    make_1_coch_curve(0,[0,0],[100,0])
    print("{} {}".format(100,0))
        

