import math

def koch(n,p1,p2):

    sx = 2/3 * p1[0] + 1/3 * p2[0]
    sy = 2/3 * p1[1] + 1/3 * p2[1]
    s = (sx,sy)

    tx = 1/3 * p1[0] + 2/3 * p2[0]
    ty = 1/3 * p1[1] + 2/3 * p2[1]
    t = (tx,ty)

    theta = math.radians(60)
    ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx
    uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy
    u = (ux,uy)

    if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return

n = int(input())
a = [0.00000000,0.00000000]
b = [100.00000000,0.00000000]
print(*map(float,a))
koch(n,a,b)
print(*map(float,b)) import math math def koch(n,p1,p2):

    sx = 2/3 * p1[0] + 1/3 * p2[0]
    sy = 2/3 * p1[1] + 1/3 * p2[1]
    s = (sx,sy)

    tx = 1/3 * p1[0] + 2/3 * p2[0]
    ty = 1/3 * p1[1] + 2/3 * p2[1]
    t = (tx,ty)

    theta = math.radians(60)
    ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx
    uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy
    u = (ux,uy)

    if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return koch sx = 2/3 * p1[0] + 1/3 * p2[0] sx 2/3 * p1[0] + 1/3 * p2[0] 2/3 * p1[0] 2/3 2 3 p1[0] p1 0 1/3 * p2[0] 1/3 1 3 p2[0] p2 0 sy = 2/3 * p1[1] + 1/3 * p2[1] sy 2/3 * p1[1] + 1/3 * p2[1] 2/3 * p1[1] 2/3 2 3 p1[1] p1 1 1/3 * p2[1] 1/3 1 3 p2[1] p2 1 s = (sx,sy) s (sx,sy) sx sy tx = 1/3 * p1[0] + 2/3 * p2[0] tx 1/3 * p1[0] + 2/3 * p2[0] 1/3 * p1[0] 1/3 1 3 p1[0] p1 0 2/3 * p2[0] 2/3 2 3 p2[0] p2 0 ty = 1/3 * p1[1] + 2/3 * p2[1] ty 1/3 * p1[1] + 2/3 * p2[1] 1/3 * p1[1] 1/3 1 3 p1[1] p1 1 2/3 * p2[1] 2/3 2 3 p2[1] p2 1 t = (tx,ty) t (tx,ty) tx ty theta = math.radians(60) theta math.radians(60) math.radians math radians 60 ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx ux (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) (tx - sx)*math.cos(theta) tx - sx tx sx math.cos(theta) math.cos math cos theta (ty - sy)*math.sin(theta) ty - sy ty sy math.sin(theta) math.sin math sin theta sx uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy uy (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) (tx - sx)*math.sin(theta) tx - sx tx sx math.sin(theta) math.sin math sin theta (ty - sy)*math.cos(theta) ty - sy ty sy math.cos(theta) math.cos math cos theta sy u = (ux,uy) u (ux,uy) ux uy if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return n>0 n 0 koch(n-1,p1,s) koch n-1 n 1 p1 s print(*s) print *s s koch(n-1,s,u) koch n-1 n 1 s u print(*u) print *u u koch(n-1,u,t) koch n-1 n 1 u t print(*t) print *t t koch(n-1,t,p2) koch n-1 n 1 t p2 n n p1 p1 p2 p2 n = int(input()) n int(input()) int input() input a = [0.00000000,0.00000000] a [0.00000000,0.00000000] 0.00000000 0.00000000 b = [100.00000000,0.00000000] b [100.00000000,0.00000000] 100.00000000 0.00000000 print(*map(float,a)) print *map(float,a) map(float,a) map float a koch(n,a,b) koch n a b print(*map(float,b)) print *map(float,b) map(float,b) map float b b = [100.00000000,0.00000000] [100.00000000,0.00000000] b a = [0.00000000,0.00000000] [0.00000000,0.00000000] a n = int(input()) int(input()) n def koch(n,p1,p2):

    sx = 2/3 * p1[0] + 1/3 * p2[0]
    sy = 2/3 * p1[1] + 1/3 * p2[1]
    s = (sx,sy)

    tx = 1/3 * p1[0] + 2/3 * p2[0]
    ty = 1/3 * p1[1] + 2/3 * p2[1]
    t = (tx,ty)

    theta = math.radians(60)
    ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx
    uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy
    u = (ux,uy)

    if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return def koch(n,p1,p2):

    sx = 2/3 * p1[0] + 1/3 * p2[0]
    sy = 2/3 * p1[1] + 1/3 * p2[1]
    s = (sx,sy)

    tx = 1/3 * p1[0] + 2/3 * p2[0]
    ty = 1/3 * p1[1] + 2/3 * p2[1]
    t = (tx,ty)

    theta = math.radians(60)
    ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx
    uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy
    u = (ux,uy)

    if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return koch
import math

def koch(n,p1,p2):

    sx = 2/3 * p1[0] + 1/3 * p2[0]
    sy = 2/3 * p1[1] + 1/3 * p2[1]
    s = (sx,sy)

    tx = 1/3 * p1[0] + 2/3 * p2[0]
    ty = 1/3 * p1[1] + 2/3 * p2[1]
    t = (tx,ty)

    theta = math.radians(60)
    ux = (tx - sx)*math.cos(theta) - (ty - sy)*math.sin(theta) + sx
    uy = (tx - sx)*math.sin(theta) + (ty - sy)*math.cos(theta) + sy
    u = (ux,uy)

    if n>0:
        koch(n-1,p1,s)
        print(*s)
        koch(n-1,s,u)
        print(*u)
        koch(n-1,u,t)
        print(*t)
        koch(n-1,t,p2)
    else: return

n = int(input())
a = [0.00000000,0.00000000]
b = [100.00000000,0.00000000]
print(*map(float,a))
koch(n,a,b)
print(*map(float,b))
