from math import pi,sin,cos

def print_p(p):
    print("{0:.8f} {1:.8f}".format(*p))

def koch(n,p1,p2):
    if n==0: return
    s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)))
    t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)))
    u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] )
    koch(n-1,p1,s)
    print_p(s)
    koch(n-1,s,u)
    print_p(u)
    koch(n-1,u,t)
    print_p(t)
    koch(n-1,t,p2)

if __name__=='__main__':
    n=int(input()) 
    p1 = [0.0  , 0.0]
    p2 = [100.0, 0.0]
    print_p(p1)
    koch(n,p1,p2)
    print_p(p2) from math import pi,sin,cos def print_p(p):
    print("{0:.8f} {1:.8f}".format(*p)) print_p print("{0:.8f} {1:.8f}".format(*p)) print "{0:.8f} {1:.8f}".format(*p) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format *p p p p def koch(n,p1,p2):
    if n==0: return
    s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)))
    t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)))
    u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] )
    koch(n-1,p1,s)
    print_p(s)
    koch(n-1,s,u)
    print_p(u)
    koch(n-1,u,t)
    print_p(t)
    koch(n-1,t,p2) koch if n==0: return
     n==0 n 0 s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2))) s tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2))) tuple map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)) map lambda z: (2*z[0]+  z[1])/3 (2*z[0]+  z[1])/3 2*z[0]+  z[1] 2*z[0] 2 z[0] z 0 z[1] z 1 3 z zip(p1,p2) zip p1 p2 t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2))) t tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2))) tuple map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)) map lambda z: (  z[0]+2*z[1])/3 (  z[0]+2*z[1])/3 z[0]+2*z[1] z[0] z 0 2*z[1] 2 z[1] z 1 3 z zip(p1,p2) zip p1 p2 u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] ) u ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] ) (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) (t[0]-s[0])*cos(60*(pi/180)) t[0]-s[0] t[0] t 0 s[0] s 0 cos(60*(pi/180)) cos 60*(pi/180) 60 pi/180 pi 180 (t[1]-s[1])*sin(60*(pi/180)) t[1]-s[1] t[1] t 1 s[1] s 1 sin(60*(pi/180)) sin 60*(pi/180) 60 pi/180 pi 180 s[0] s 0 (t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] (t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) (t[0]-s[0])*sin(60*(pi/180)) t[0]-s[0] t[0] t 0 s[0] s 0 sin(60*(pi/180)) sin 60*(pi/180) 60 pi/180 pi 180 (t[1]-s[1])*cos(60*(pi/180)) t[1]-s[1] t[1] t 1 s[1] s 1 cos(60*(pi/180)) cos 60*(pi/180) 60 pi/180 pi 180 s[1] s 1 koch(n-1,p1,s) koch n-1 n 1 p1 s print_p(s) print_p s koch(n-1,s,u) koch n-1 n 1 s u print_p(u) print_p u koch(n-1,u,t) koch n-1 n 1 u t print_p(t) print_p t koch(n-1,t,p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 if __name__=='__main__':
    n=int(input()) 
    p1 = [0.0  , 0.0]
    p2 = [100.0, 0.0]
    print_p(p1)
    koch(n,p1,p2)
    print_p(p2) __name__=='__main__' __name__ '__main__' n=int(input()) n int(input()) int input() input p1 = [0.0  , 0.0] p1 [0.0  , 0.0] 0.0 0.0 p2 = [100.0, 0.0] p2 [100.0, 0.0] 100.0 0.0 print_p(p1) print_p p1 koch(n,p1,p2) koch n p1 p2 print_p(p2) print_p p2 p1 = [0.0  , 0.0] [0.0  , 0.0] p1 p2 = [100.0, 0.0] [100.0, 0.0] p2 n=int(input()) int(input()) n def print_p(p):
    print("{0:.8f} {1:.8f}".format(*p)) def print_p(p):
    print("{0:.8f} {1:.8f}".format(*p)) print_p def koch(n,p1,p2):
    if n==0: return
    s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)))
    t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)))
    u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] )
    koch(n-1,p1,s)
    print_p(s)
    koch(n-1,s,u)
    print_p(u)
    koch(n-1,u,t)
    print_p(t)
    koch(n-1,t,p2) def koch(n,p1,p2):
    if n==0: return
    s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)))
    t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)))
    u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] )
    koch(n-1,p1,s)
    print_p(s)
    koch(n-1,s,u)
    print_p(u)
    koch(n-1,u,t)
    print_p(t)
    koch(n-1,t,p2) koch
from math import pi,sin,cos

def print_p(p):
    print("{0:.8f} {1:.8f}".format(*p))

def koch(n,p1,p2):
    if n==0: return
    s = tuple(map(lambda z: (2*z[0]+  z[1])/3, zip(p1,p2)))
    t = tuple(map(lambda z: (  z[0]+2*z[1])/3, zip(p1,p2)))
    u = ( (t[0]-s[0])*cos(60*(pi/180)) - (t[1]-s[1])*sin(60*(pi/180)) + s[0] \
         ,(t[0]-s[0])*sin(60*(pi/180)) + (t[1]-s[1])*cos(60*(pi/180)) + s[1] )
    koch(n-1,p1,s)
    print_p(s)
    koch(n-1,s,u)
    print_p(u)
    koch(n-1,u,t)
    print_p(t)
    koch(n-1,t,p2)

if __name__=='__main__':
    n=int(input()) 
    p1 = [0.0  , 0.0]
    p2 = [100.0, 0.0]
    print_p(p1)
    koch(n,p1,p2)
    print_p(p2)