import math
cos60=math.cos(math.radians(60))
sin60=math.sin(math.radians(60))

def koch(d,p1_x,p2_x,p1_y,p2_y):
    if d==0:
        return 

    s_x=(2*p1_x+1*p2_x)/3
    s_y=(2*p1_y+1*p2_y)/3
    t_x=(1*p1_x+2*p2_x)/3
    t_y=(1*p1_y+2*p2_y)/3
    u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x
    u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y
    
    koch(d-1,p1_x,s_x,p1_y,s_y)
    print(s_x,s_y)
    koch(d-1,s_x,u_x,s_y,u_y)
    print(u_x,u_y)
    koch(d-1,u_x,t_x,u_y,t_y)
    print(t_x,t_y)
    koch(d-1,t_x,p2_x,t_y,p2_y)
    
d=int(input())
p1_y=0
p1_x=0
p2_x=100
p2_y=0
print(float(p1_x),float(p1_y))
koch(d,p1_x,p2_x,p1_y,p2_y)
print(float(p2_x),float(p2_y)) import math math cos60=math.cos(math.radians(60)) cos60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sin60=math.sin(math.radians(60)) sin60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 def koch(d,p1_x,p2_x,p1_y,p2_y):
    if d==0:
        return 

    s_x=(2*p1_x+1*p2_x)/3
    s_y=(2*p1_y+1*p2_y)/3
    t_x=(1*p1_x+2*p2_x)/3
    t_y=(1*p1_y+2*p2_y)/3
    u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x
    u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y
    
    koch(d-1,p1_x,s_x,p1_y,s_y)
    print(s_x,s_y)
    koch(d-1,s_x,u_x,s_y,u_y)
    print(u_x,u_y)
    koch(d-1,u_x,t_x,u_y,t_y)
    print(t_x,t_y)
    koch(d-1,t_x,p2_x,t_y,p2_y)
     koch if d==0:
        return 

     d==0 d 0 return s_x=(2*p1_x+1*p2_x)/3 s_x (2*p1_x+1*p2_x)/3 2*p1_x+1*p2_x 2*p1_x 2 p1_x 1*p2_x 1 p2_x 3 s_y=(2*p1_y+1*p2_y)/3 s_y (2*p1_y+1*p2_y)/3 2*p1_y+1*p2_y 2*p1_y 2 p1_y 1*p2_y 1 p2_y 3 t_x=(1*p1_x+2*p2_x)/3 t_x (1*p1_x+2*p2_x)/3 1*p1_x+2*p2_x 1*p1_x 1 p1_x 2*p2_x 2 p2_x 3 t_y=(1*p1_y+2*p2_y)/3 t_y (1*p1_y+2*p2_y)/3 1*p1_y+2*p2_y 1*p1_y 1 p1_y 2*p2_y 2 p2_y 3 u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x u_x (t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x (t_x-s_x)*cos60-(t_y-s_y)*sin60 (t_x-s_x)*cos60 t_x-s_x t_x s_x cos60 (t_y-s_y)*sin60 t_y-s_y t_y s_y sin60 s_x u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y u_y (t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y (t_x-s_x)*sin60+(t_y-s_y)*cos60 (t_x-s_x)*sin60 t_x-s_x t_x s_x sin60 (t_y-s_y)*cos60 t_y-s_y t_y s_y cos60 s_y koch(d-1,p1_x,s_x,p1_y,s_y) koch d-1 d 1 p1_x s_x p1_y s_y print(s_x,s_y) print s_x s_y koch(d-1,s_x,u_x,s_y,u_y) koch d-1 d 1 s_x u_x s_y u_y print(u_x,u_y) print u_x u_y koch(d-1,u_x,t_x,u_y,t_y) koch d-1 d 1 u_x t_x u_y t_y print(t_x,t_y) print t_x t_y koch(d-1,t_x,p2_x,t_y,p2_y) koch d-1 d 1 t_x p2_x t_y p2_y d d p1_x p1_x p2_x p2_x p1_y p1_y p2_y p2_y d=int(input()) d int(input()) int input() input p1_y=0 p1_y 0 p1_x=0 p1_x 0 p2_x=100 p2_x 100 p2_y=0 p2_y 0 print(float(p1_x),float(p1_y)) print float(p1_x) float p1_x float(p1_y) float p1_y koch(d,p1_x,p2_x,p1_y,p2_y) koch d p1_x p2_x p1_y p2_y print(float(p2_x),float(p2_y)) print float(p2_x) float p2_x float(p2_y) float p2_y p1_x=0 0 p1_x p2_y=0 0 p2_y cos60=math.cos(math.radians(60)) math.cos(math.radians(60)) cos60 p1_y=0 0 p1_y d=int(input()) int(input()) d p2_x=100 100 p2_x sin60=math.sin(math.radians(60)) math.sin(math.radians(60)) sin60 def koch(d,p1_x,p2_x,p1_y,p2_y):
    if d==0:
        return 

    s_x=(2*p1_x+1*p2_x)/3
    s_y=(2*p1_y+1*p2_y)/3
    t_x=(1*p1_x+2*p2_x)/3
    t_y=(1*p1_y+2*p2_y)/3
    u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x
    u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y
    
    koch(d-1,p1_x,s_x,p1_y,s_y)
    print(s_x,s_y)
    koch(d-1,s_x,u_x,s_y,u_y)
    print(u_x,u_y)
    koch(d-1,u_x,t_x,u_y,t_y)
    print(t_x,t_y)
    koch(d-1,t_x,p2_x,t_y,p2_y)
     def koch(d,p1_x,p2_x,p1_y,p2_y):
    if d==0:
        return 

    s_x=(2*p1_x+1*p2_x)/3
    s_y=(2*p1_y+1*p2_y)/3
    t_x=(1*p1_x+2*p2_x)/3
    t_y=(1*p1_y+2*p2_y)/3
    u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x
    u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y
    
    koch(d-1,p1_x,s_x,p1_y,s_y)
    print(s_x,s_y)
    koch(d-1,s_x,u_x,s_y,u_y)
    print(u_x,u_y)
    koch(d-1,u_x,t_x,u_y,t_y)
    print(t_x,t_y)
    koch(d-1,t_x,p2_x,t_y,p2_y)
     koch
import math
cos60=math.cos(math.radians(60))
sin60=math.sin(math.radians(60))

def koch(d,p1_x,p2_x,p1_y,p2_y):
    if d==0:
        return 

    s_x=(2*p1_x+1*p2_x)/3
    s_y=(2*p1_y+1*p2_y)/3
    t_x=(1*p1_x+2*p2_x)/3
    t_y=(1*p1_y+2*p2_y)/3
    u_x=(t_x-s_x)*cos60-(t_y-s_y)*sin60+s_x
    u_y=(t_x-s_x)*sin60+(t_y-s_y)*cos60+s_y
    
    koch(d-1,p1_x,s_x,p1_y,s_y)
    print(s_x,s_y)
    koch(d-1,s_x,u_x,s_y,u_y)
    print(u_x,u_y)
    koch(d-1,u_x,t_x,u_y,t_y)
    print(t_x,t_y)
    koch(d-1,t_x,p2_x,t_y,p2_y)
    
d=int(input())
p1_y=0
p1_x=0
p2_x=100
p2_y=0
print(float(p1_x),float(p1_y))
koch(d,p1_x,p2_x,p1_y,p2_y)
print(float(p2_x),float(p2_y))
