import sys
import math

n = int(sys.stdin.readline())


def koch(st, en):

    st_x, st_y = st[0], st[1]
    en_x, en_y = en[0], en[1]

    p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3
    p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3

    vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y)  # vec p1->p2

    # 60°回転
    vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3)
    vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3)

    p3_x = vec_r_x + p1_x
    p3_y = vec_r_y + p1_y

    return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y)


def koch_r(n, st, en):
    if n == 0:
        return
    
    s, u, t = koch(st, en)
    
    koch_r(n - 1, st, s)
    print(f"{s[0]:f} {s[1]:f}")
    koch_r(n - 1, s, u)
    print(f"{u[0]:f} {u[1]:f}")
    koch_r(n - 1, u, t)
    print(f"{t[0]:f} {t[1]:f}")
    koch_r(n - 1, t, en)


st, en = (0, 0), (100, 0)

print(f"{st[0]:f} {st[1]:f}")
koch_r(n, st, en)
print(f"{en[0]:f} {en[1]:f}")
 import sys sys import math math n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline def koch(st, en):

    st_x, st_y = st[0], st[1]
    en_x, en_y = en[0], en[1]

    p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3
    p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3

    vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y)  # vec p1->p2

    # 60°回転
    vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3)
    vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3)

    p3_x = vec_r_x + p1_x
    p3_y = vec_r_y + p1_y

    return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y) koch st_x, st_y = st[0], st[1] st_x st[0] st 0 st_y st[1] st 1 en_x, en_y = en[0], en[1] en_x en[0] en 0 en_y en[1] en 1 p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3 p1_x (2 * st_x + en_x) / 3 2 * st_x + en_x 2 * st_x 2 st_x en_x 3 p1_y (2 * st_y + en_y) / 3 2 * st_y + en_y 2 * st_y 2 st_y en_y 3 p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3 p2_x (st_x + 2 * en_x) / 3 st_x + 2 * en_x st_x 2 * en_x 2 en_x 3 p2_y (st_y + 2 * en_y) / 3 st_y + 2 * en_y st_y 2 * en_y 2 en_y 3 vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y) vec_x (p2_x - p1_x, p2_y - p1_y) p2_x - p1_x p2_x p1_x p2_y - p1_y p2_y p1_y vec_y vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3) vec_r_x vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3) vec_x * math.cos(math.pi / 3) vec_x math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 vec_y * math.sin(math.pi / 3) vec_y math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3) vec_r_y vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3) vec_x * math.sin(math.pi / 3) vec_x math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 vec_y * math.cos(math.pi / 3) vec_y math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 p3_x = vec_r_x + p1_x p3_x vec_r_x + p1_x vec_r_x p1_x p3_y = vec_r_y + p1_y p3_y vec_r_y + p1_y vec_r_y p1_y return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y) return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y) (p1_x, p1_y) p1_x p1_y (p3_x, p3_y) p3_x p3_y (p2_x, p2_y) p2_x p2_y st st en en def koch_r(n, st, en):
    if n == 0:
        return
    
    s, u, t = koch(st, en)
    
    koch_r(n - 1, st, s)
    print(f"{s[0]:f} {s[1]:f}")
    koch_r(n - 1, s, u)
    print(f"{u[0]:f} {u[1]:f}")
    koch_r(n - 1, u, t)
    print(f"{t[0]:f} {t[1]:f}")
    koch_r(n - 1, t, en) koch_r if n == 0:
        return
    
     n == 0 n 0 return s, u, t = koch(st, en) s koch(st, en) koch st en u t koch_r(n - 1, st, s) koch_r n - 1 n 1 st s print(f"{s[0]:f} {s[1]:f}") print f"{s[0]:f} {s[1]:f}" koch_r(n - 1, s, u) koch_r n - 1 n 1 s u print(f"{u[0]:f} {u[1]:f}") print f"{u[0]:f} {u[1]:f}" koch_r(n - 1, u, t) koch_r n - 1 n 1 u t print(f"{t[0]:f} {t[1]:f}") print f"{t[0]:f} {t[1]:f}" koch_r(n - 1, t, en) koch_r n - 1 n 1 t en n n st st en en st, en = (0, 0), (100, 0) st (0, 0) 0 0 en (100, 0) 100 0 print(f"{st[0]:f} {st[1]:f}") print f"{st[0]:f} {st[1]:f}" koch_r(n, st, en) koch_r n st en print(f"{en[0]:f} {en[1]:f}") print f"{en[0]:f} {en[1]:f}" n = int(sys.stdin.readline()) int(sys.stdin.readline()) n def koch_r(n, st, en):
    if n == 0:
        return
    
    s, u, t = koch(st, en)
    
    koch_r(n - 1, st, s)
    print(f"{s[0]:f} {s[1]:f}")
    koch_r(n - 1, s, u)
    print(f"{u[0]:f} {u[1]:f}")
    koch_r(n - 1, u, t)
    print(f"{t[0]:f} {t[1]:f}")
    koch_r(n - 1, t, en) def koch_r(n, st, en):
    if n == 0:
        return
    
    s, u, t = koch(st, en)
    
    koch_r(n - 1, st, s)
    print(f"{s[0]:f} {s[1]:f}")
    koch_r(n - 1, s, u)
    print(f"{u[0]:f} {u[1]:f}")
    koch_r(n - 1, u, t)
    print(f"{t[0]:f} {t[1]:f}")
    koch_r(n - 1, t, en) koch_r en = (0, 0), (100, 0) (100, 0) en st, en = (0, 0), (100, 0) (0, 0) st def koch(st, en):

    st_x, st_y = st[0], st[1]
    en_x, en_y = en[0], en[1]

    p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3
    p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3

    vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y)  # vec p1->p2

    # 60°回転
    vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3)
    vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3)

    p3_x = vec_r_x + p1_x
    p3_y = vec_r_y + p1_y

    return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y) def koch(st, en):

    st_x, st_y = st[0], st[1]
    en_x, en_y = en[0], en[1]

    p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3
    p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3

    vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y)  # vec p1->p2

    # 60°回転
    vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3)
    vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3)

    p3_x = vec_r_x + p1_x
    p3_y = vec_r_y + p1_y

    return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y) koch
import sys
import math

n = int(sys.stdin.readline())


def koch(st, en):

    st_x, st_y = st[0], st[1]
    en_x, en_y = en[0], en[1]

    p1_x, p1_y = (2 * st_x + en_x) / 3, (2 * st_y + en_y) / 3
    p2_x, p2_y = (st_x + 2 * en_x) / 3, (st_y + 2 * en_y) / 3

    vec_x, vec_y = (p2_x - p1_x, p2_y - p1_y)  # vec p1->p2

    # 60°回転
    vec_r_x = vec_x * math.cos(math.pi / 3) - vec_y * math.sin(math.pi / 3)
    vec_r_y = vec_x * math.sin(math.pi / 3) + vec_y * math.cos(math.pi / 3)

    p3_x = vec_r_x + p1_x
    p3_y = vec_r_y + p1_y

    return (p1_x, p1_y), (p3_x, p3_y), (p2_x, p2_y)


def koch_r(n, st, en):
    if n == 0:
        return
    
    s, u, t = koch(st, en)
    
    koch_r(n - 1, st, s)
    print(f"{s[0]:f} {s[1]:f}")
    koch_r(n - 1, s, u)
    print(f"{u[0]:f} {u[1]:f}")
    koch_r(n - 1, u, t)
    print(f"{t[0]:f} {t[1]:f}")
    koch_r(n - 1, t, en)


st, en = (0, 0), (100, 0)

print(f"{st[0]:f} {st[1]:f}")
koch_r(n, st, en)
print(f"{en[0]:f} {en[1]:f}")

