import math
n = int(input())

def koch(n, p1, p2):
    if n == 0:
        return

    sx = (2*p1['x'] + 1*p2['x'])/3
    sy = (2*p1['y'] + 1*p2['y'])/3
    tx = (1*p1['x'] + 2*p2['x'])/3
    ty = (1*p1['y'] + 2*p2['y'])/3
    ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx
    uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy
    
    s = {'x':sx, 'y':sy}
    t = {'x':tx, 'y':ty}
    u = {'x':ux, 'y':uy}

    koch(n-1,p1,s)
    print('{} {}'.format(s['x'],s['y']))
    koch(n-1, s, u)
    print('{} {}'.format(u['x'],u['y']))
    koch(n-1, u, t)
    print('{} {}'.format(t['x'],t['y']))
    koch(n-1,t,p2)

p1 = {'x':float(0),'y':float(0)}
p2 = {'x':float(100),'y':float(0)}
print('{} {}'.format(p1['x'],p1['y']))
koch(n, p1, p2)
print('{} {}'.format(p2['x'],p2['y']))
 import math math n = int(input()) n int(input()) int input() input def koch(n, p1, p2):
    if n == 0:
        return

    sx = (2*p1['x'] + 1*p2['x'])/3
    sy = (2*p1['y'] + 1*p2['y'])/3
    tx = (1*p1['x'] + 2*p2['x'])/3
    ty = (1*p1['y'] + 2*p2['y'])/3
    ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx
    uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy
    
    s = {'x':sx, 'y':sy}
    t = {'x':tx, 'y':ty}
    u = {'x':ux, 'y':uy}

    koch(n-1,p1,s)
    print('{} {}'.format(s['x'],s['y']))
    koch(n-1, s, u)
    print('{} {}'.format(u['x'],u['y']))
    koch(n-1, u, t)
    print('{} {}'.format(t['x'],t['y']))
    koch(n-1,t,p2) koch if n == 0:
        return

     n == 0 n 0 return sx = (2*p1['x'] + 1*p2['x'])/3 sx (2*p1['x'] + 1*p2['x'])/3 2*p1['x'] + 1*p2['x'] 2*p1['x'] 2 p1['x'] p1 'x' 1*p2['x'] 1 p2['x'] p2 'x' 3 sy = (2*p1['y'] + 1*p2['y'])/3 sy (2*p1['y'] + 1*p2['y'])/3 2*p1['y'] + 1*p2['y'] 2*p1['y'] 2 p1['y'] p1 'y' 1*p2['y'] 1 p2['y'] p2 'y' 3 tx = (1*p1['x'] + 2*p2['x'])/3 tx (1*p1['x'] + 2*p2['x'])/3 1*p1['x'] + 2*p2['x'] 1*p1['x'] 1 p1['x'] p1 'x' 2*p2['x'] 2 p2['x'] p2 'x' 3 ty = (1*p1['y'] + 2*p2['y'])/3 ty (1*p1['y'] + 2*p2['y'])/3 1*p1['y'] + 2*p2['y'] 1*p1['y'] 1 p1['y'] p1 'y' 2*p2['y'] 2 p2['y'] p2 'y' 3 ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx ux (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) (tx - sx)*math.cos(math.radians(60)) tx - sx tx sx math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (ty - sy)*math.sin(math.radians(60)) ty - sy ty sy math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 sx uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy uy (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) (tx - sx)*math.sin(math.radians(60)) tx - sx tx sx math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (ty -sy)*math.cos(math.radians(60)) ty -sy ty sy math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sy s = {'x':sx, 'y':sy} s {'x':sx, 'y':sy} 'x' 'x' sx 'y' 'y' sy t = {'x':tx, 'y':ty} t {'x':tx, 'y':ty} 'x' 'x' tx 'y' 'y' ty u = {'x':ux, 'y':uy} u {'x':ux, 'y':uy} 'x' 'x' ux 'y' 'y' uy koch(n-1,p1,s) koch n-1 n 1 p1 s print('{} {}'.format(s['x'],s['y'])) print '{} {}'.format(s['x'],s['y']) '{} {}'.format '{} {}' format s['x'] s 'x' s['y'] s 'y' koch(n-1, s, u) koch n-1 n 1 s u print('{} {}'.format(u['x'],u['y'])) print '{} {}'.format(u['x'],u['y']) '{} {}'.format '{} {}' format u['x'] u 'x' u['y'] u 'y' koch(n-1, u, t) koch n-1 n 1 u t print('{} {}'.format(t['x'],t['y'])) print '{} {}'.format(t['x'],t['y']) '{} {}'.format '{} {}' format t['x'] t 'x' t['y'] t 'y' koch(n-1,t,p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 p1 = {'x':float(0),'y':float(0)} p1 {'x':float(0),'y':float(0)} 'x' 'x' float(0) float 0 'y' 'y' float(0) float 0 p2 = {'x':float(100),'y':float(0)} p2 {'x':float(100),'y':float(0)} 'x' 'x' float(100) float 100 'y' 'y' float(0) float 0 print('{} {}'.format(p1['x'],p1['y'])) print '{} {}'.format(p1['x'],p1['y']) '{} {}'.format '{} {}' format p1['x'] p1 'x' p1['y'] p1 'y' koch(n, p1, p2) koch n p1 p2 print('{} {}'.format(p2['x'],p2['y'])) print '{} {}'.format(p2['x'],p2['y']) '{} {}'.format '{} {}' format p2['x'] p2 'x' p2['y'] p2 'y' p1 = {'x':float(0),'y':float(0)} {'x':float(0),'y':float(0)} p1 def koch(n, p1, p2):
    if n == 0:
        return

    sx = (2*p1['x'] + 1*p2['x'])/3
    sy = (2*p1['y'] + 1*p2['y'])/3
    tx = (1*p1['x'] + 2*p2['x'])/3
    ty = (1*p1['y'] + 2*p2['y'])/3
    ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx
    uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy
    
    s = {'x':sx, 'y':sy}
    t = {'x':tx, 'y':ty}
    u = {'x':ux, 'y':uy}

    koch(n-1,p1,s)
    print('{} {}'.format(s['x'],s['y']))
    koch(n-1, s, u)
    print('{} {}'.format(u['x'],u['y']))
    koch(n-1, u, t)
    print('{} {}'.format(t['x'],t['y']))
    koch(n-1,t,p2) def koch(n, p1, p2):
    if n == 0:
        return

    sx = (2*p1['x'] + 1*p2['x'])/3
    sy = (2*p1['y'] + 1*p2['y'])/3
    tx = (1*p1['x'] + 2*p2['x'])/3
    ty = (1*p1['y'] + 2*p2['y'])/3
    ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx
    uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy
    
    s = {'x':sx, 'y':sy}
    t = {'x':tx, 'y':ty}
    u = {'x':ux, 'y':uy}

    koch(n-1,p1,s)
    print('{} {}'.format(s['x'],s['y']))
    koch(n-1, s, u)
    print('{} {}'.format(u['x'],u['y']))
    koch(n-1, u, t)
    print('{} {}'.format(t['x'],t['y']))
    koch(n-1,t,p2) koch n = int(input()) int(input()) n p2 = {'x':float(100),'y':float(0)} {'x':float(100),'y':float(0)} p2
import math
n = int(input())

def koch(n, p1, p2):
    if n == 0:
        return

    sx = (2*p1['x'] + 1*p2['x'])/3
    sy = (2*p1['y'] + 1*p2['y'])/3
    tx = (1*p1['x'] + 2*p2['x'])/3
    ty = (1*p1['y'] + 2*p2['y'])/3
    ux = (tx - sx)*math.cos(math.radians(60)) - (ty - sy)*math.sin(math.radians(60)) + sx
    uy = (tx - sx)*math.sin(math.radians(60)) + (ty -sy)*math.cos(math.radians(60)) + sy
    
    s = {'x':sx, 'y':sy}
    t = {'x':tx, 'y':ty}
    u = {'x':ux, 'y':uy}

    koch(n-1,p1,s)
    print('{} {}'.format(s['x'],s['y']))
    koch(n-1, s, u)
    print('{} {}'.format(u['x'],u['y']))
    koch(n-1, u, t)
    print('{} {}'.format(t['x'],t['y']))
    koch(n-1,t,p2)

p1 = {'x':float(0),'y':float(0)}
p2 = {'x':float(100),'y':float(0)}
print('{} {}'.format(p1['x'],p1['y']))
koch(n, p1, p2)
print('{} {}'.format(p2['x'],p2['y']))

