from typing import List
import math

def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    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
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2)

n = int(input())
p1 = [0, 0]
p2 = [100, 0]
print(*p1)
koch_curve(n, p1, p2)
print(*p2) from typing import List import math math def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    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
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2) koch_curve if n == 0:
        return
     n == 0 n 0 return p1x, p1y = p1 p1x p1 p1y p2x, p2y = p2 p2x p2 p2y (r - l) / 3 + l for (l, r) in zip(p1, p2) for (l, r) in zip(p1, p2) (l, r) l r zip(p1, p2) zip p1 p2 for (l, r) in zip(p1, p2) (r - l) / 3 + l (r - l) / 3 r - l r l 3 l s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)] s [(r - l) / 3 + l for (l, r) in zip(p1, p2)] (r - l) * 2 / 3 + l for (l, r) in zip(p1, p2) for (l, r) in zip(p1, p2) (l, r) l r zip(p1, p2) zip p1 p2 for (l, r) in zip(p1, p2) (r - l) * 2 / 3 + l (r - l) * 2 / 3 (r - l) * 2 r - l r l 2 3 l t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)] t [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)] sx, sy = s sx s sy tx, ty = t tx t ty 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 u = [ux, uy] u [ux, uy] ux uy n -= 1 n 1 koch_curve(n, p1, s) koch_curve n p1 s print(*s) print *s s koch_curve(n, s, u) koch_curve n s u print(*u) print *u u koch_curve(n, u, t) koch_curve n u t print(*t) print *t t koch_curve(n, t, p2) koch_curve n t p2 n: int n p1: List[float] p1 p2: List[float] p2 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 print(*p1) print *p1 p1 koch_curve(n, p1, p2) koch_curve n p1 p2 print(*p2) print *p2 p2 p1 = [0, 0] [0, 0] p1 n = int(input()) int(input()) n p2 = [100, 0] [100, 0] p2 def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    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
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2) def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    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
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2) koch_curve
from typing import List
import math

def koch_curve(n: int, p1: List[float], p2: List[float]):
    if n == 0:
        return
    p1x, p1y = p1
    p2x, p2y = p2
    s = [(r - l) / 3 + l for (l, r) in zip(p1, p2)]
    t = [(r - l) * 2 / 3 + l for (l, r) in zip(p1, p2)]
    sx, sy = s
    tx, ty = t
    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
    u = [ux, uy]
    n -= 1
    koch_curve(n, p1, s)
    print(*s)
    koch_curve(n, s, u)
    print(*u)
    koch_curve(n, u, t)
    print(*t)
    koch_curve(n, t, p2)

n = int(input())
p1 = [0, 0]
p2 = [100, 0]
print(*p1)
koch_curve(n, p1, p2)
print(*p2)
