import math

n = int(input())
p1 = (0, 0)
p2 = (100, 0)
points = []

def koch(n, p, q):
    if n == 0:
        return

    x1, y1 = p
    x2, y2 = q
    sx = (2 * x1 + 1 * x2) / 3
    sy = (2 * y1 + 1 * y2) / 3
    s = (sx, sy)
    tx = (1 * x1 + 2 * x2) / 3
    ty = (1 * y1 + 2 * y2) / 3
    t = (tx, ty)
    theta = math.pi / 3
    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)

    koch(n - 1, p, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, q)


print(*p1)
koch(n, p1, p2)
print(*p2)
 import math math n = int(input()) n int(input()) int input() input p1 = (0, 0) p1 (0, 0) 0 0 p2 = (100, 0) p2 (100, 0) 100 0 points = [] points [] def koch(n, p, q):
    if n == 0:
        return

    x1, y1 = p
    x2, y2 = q
    sx = (2 * x1 + 1 * x2) / 3
    sy = (2 * y1 + 1 * y2) / 3
    s = (sx, sy)
    tx = (1 * x1 + 2 * x2) / 3
    ty = (1 * y1 + 2 * y2) / 3
    t = (tx, ty)
    theta = math.pi / 3
    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)

    koch(n - 1, p, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, q) koch if n == 0:
        return

     n == 0 n 0 return x1, y1 = p x1 p y1 x2, y2 = q x2 q y2 sx = (2 * x1 + 1 * x2) / 3 sx (2 * x1 + 1 * x2) / 3 2 * x1 + 1 * x2 2 * x1 2 x1 1 * x2 1 x2 3 sy = (2 * y1 + 1 * y2) / 3 sy (2 * y1 + 1 * y2) / 3 2 * y1 + 1 * y2 2 * y1 2 y1 1 * y2 1 y2 3 s = (sx, sy) s (sx, sy) sx sy tx = (1 * x1 + 2 * x2) / 3 tx (1 * x1 + 2 * x2) / 3 1 * x1 + 2 * x2 1 * x1 1 x1 2 * x2 2 x2 3 ty = (1 * y1 + 2 * y2) / 3 ty (1 * y1 + 2 * y2) / 3 1 * y1 + 2 * y2 1 * y1 1 y1 2 * y2 2 y2 3 t = (tx, ty) t (tx, ty) tx ty theta = math.pi / 3 theta math.pi / 3 math.pi math pi 3 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 koch(n - 1, p, s) koch n - 1 n 1 p 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, q) koch n - 1 n 1 t q n n p p q q print(*p1) print *p1 p1 koch(n, p1, p2) koch n p1 p2 print(*p2) print *p2 p2 p2 = (100, 0) (100, 0) p2 n = int(input()) int(input()) n def koch(n, p, q):
    if n == 0:
        return

    x1, y1 = p
    x2, y2 = q
    sx = (2 * x1 + 1 * x2) / 3
    sy = (2 * y1 + 1 * y2) / 3
    s = (sx, sy)
    tx = (1 * x1 + 2 * x2) / 3
    ty = (1 * y1 + 2 * y2) / 3
    t = (tx, ty)
    theta = math.pi / 3
    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)

    koch(n - 1, p, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, q) def koch(n, p, q):
    if n == 0:
        return

    x1, y1 = p
    x2, y2 = q
    sx = (2 * x1 + 1 * x2) / 3
    sy = (2 * y1 + 1 * y2) / 3
    s = (sx, sy)
    tx = (1 * x1 + 2 * x2) / 3
    ty = (1 * y1 + 2 * y2) / 3
    t = (tx, ty)
    theta = math.pi / 3
    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)

    koch(n - 1, p, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, q) koch points = [] [] points p1 = (0, 0) (0, 0) p1
import math

n = int(input())
p1 = (0, 0)
p2 = (100, 0)
points = []

def koch(n, p, q):
    if n == 0:
        return

    x1, y1 = p
    x2, y2 = q
    sx = (2 * x1 + 1 * x2) / 3
    sy = (2 * y1 + 1 * y2) / 3
    s = (sx, sy)
    tx = (1 * x1 + 2 * x2) / 3
    ty = (1 * y1 + 2 * y2) / 3
    t = (tx, ty)
    theta = math.pi / 3
    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)

    koch(n - 1, p, s)
    print(*s)
    koch(n - 1, s, u)
    print(*u)
    koch(n - 1, u, t)
    print(*t)
    koch(n - 1, t, q)


print(*p1)
koch(n, p1, p2)
print(*p2)

