from math import sqrt

def koch(n, c1, c2):
    if n == 0:
        return
    
    # 処理
    v = [c2[0] - c1[0], c2[1] - c1[1]]

    s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3]
    t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3]
    u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6]

    koch(n-1, c1, s)
    print(" ".join(map(str, s)))
    koch(n-1, s, u)
    print(" ".join(map(str, u)))
    koch(n-1, u, t)
    print(" ".join(map(str, t)))
    koch(n-1, t, c2)


    

def main():
    fmt = "%.8f %.8f"
    q3 = sqrt(3)

    c1 = [0, 0]
    c2 = [100, 0]

    n = int(input())
    print(fmt % tuple(c1))
    koch(n, c1, c2)
    print(fmt % tuple(c2))

main() from math import sqrt def koch(n, c1, c2):
    if n == 0:
        return
    
    # 処理
    v = [c2[0] - c1[0], c2[1] - c1[1]]

    s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3]
    t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3]
    u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6]

    koch(n-1, c1, s)
    print(" ".join(map(str, s)))
    koch(n-1, s, u)
    print(" ".join(map(str, u)))
    koch(n-1, u, t)
    print(" ".join(map(str, t)))
    koch(n-1, t, c2)


     koch if n == 0:
        return
    
    # 処理
     n == 0 n 0 return v = [c2[0] - c1[0], c2[1] - c1[1]] v [c2[0] - c1[0], c2[1] - c1[1]] c2[0] - c1[0] c2[0] c2 0 c1[0] c1 0 c2[1] - c1[1] c2[1] c2 1 c1[1] c1 1 s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3] s [c1[0] + v[0] / 3, c1[1] + v[1] / 3] c1[0] + v[0] / 3 c1[0] c1 0 v[0] / 3 v[0] v 0 3 c1[1] + v[1] / 3 c1[1] c1 1 v[1] / 3 v[1] v 1 3 t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3] t [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3] c1[0] + 2 * v[0] / 3 c1[0] c1 0 2 * v[0] / 3 2 * v[0] 2 v[0] v 0 3 c1[1] + 2 * v[1] / 3 c1[1] c1 1 2 * v[1] / 3 2 * v[1] 2 v[1] v 1 3 u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6] u [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6] c1[0] + v[0]/2 - v[1] * sqrt(3) / 6 c1[0] + v[0]/2 c1[0] c1 0 v[0]/2 v[0] v 0 2 v[1] * sqrt(3) / 6 v[1] * sqrt(3) v[1] v 1 sqrt(3) sqrt 3 6 c1[1] + v[1]/2 + v[0] * sqrt(3) / 6 c1[1] + v[1]/2 c1[1] c1 1 v[1]/2 v[1] v 1 2 v[0] * sqrt(3) / 6 v[0] * sqrt(3) v[0] v 0 sqrt(3) sqrt 3 6 koch(n-1, c1, s) koch n-1 n 1 c1 s print(" ".join(map(str, s))) print " ".join(map(str, s)) " ".join " " join map(str, s) map str s koch(n-1, s, u) koch n-1 n 1 s u print(" ".join(map(str, u))) print " ".join(map(str, u)) " ".join " " join map(str, u) map str u koch(n-1, u, t) koch n-1 n 1 u t print(" ".join(map(str, t))) print " ".join(map(str, t)) " ".join " " join map(str, t) map str t koch(n-1, t, c2) koch n-1 n 1 t c2 n n c1 c1 c2 c2 def main():
    fmt = "%.8f %.8f"
    q3 = sqrt(3)

    c1 = [0, 0]
    c2 = [100, 0]

    n = int(input())
    print(fmt % tuple(c1))
    koch(n, c1, c2)
    print(fmt % tuple(c2)) main fmt = "%.8f %.8f" fmt "%.8f %.8f" q3 = sqrt(3) q3 sqrt(3) sqrt 3 c1 = [0, 0] c1 [0, 0] 0 0 c2 = [100, 0] c2 [100, 0] 100 0 n = int(input()) n int(input()) int input() input print(fmt % tuple(c1)) print fmt % tuple(c1) fmt tuple(c1) tuple c1 koch(n, c1, c2) koch n c1 c2 print(fmt % tuple(c2)) print fmt % tuple(c2) fmt tuple(c2) tuple c2 main() main def koch(n, c1, c2):
    if n == 0:
        return
    
    # 処理
    v = [c2[0] - c1[0], c2[1] - c1[1]]

    s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3]
    t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3]
    u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6]

    koch(n-1, c1, s)
    print(" ".join(map(str, s)))
    koch(n-1, s, u)
    print(" ".join(map(str, u)))
    koch(n-1, u, t)
    print(" ".join(map(str, t)))
    koch(n-1, t, c2)


     def koch(n, c1, c2):
    if n == 0:
        return
    
    # 処理
    v = [c2[0] - c1[0], c2[1] - c1[1]]

    s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3]
    t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3]
    u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6]

    koch(n-1, c1, s)
    print(" ".join(map(str, s)))
    koch(n-1, s, u)
    print(" ".join(map(str, u)))
    koch(n-1, u, t)
    print(" ".join(map(str, t)))
    koch(n-1, t, c2)


     koch def main():
    fmt = "%.8f %.8f"
    q3 = sqrt(3)

    c1 = [0, 0]
    c2 = [100, 0]

    n = int(input())
    print(fmt % tuple(c1))
    koch(n, c1, c2)
    print(fmt % tuple(c2)) def main():
    fmt = "%.8f %.8f"
    q3 = sqrt(3)

    c1 = [0, 0]
    c2 = [100, 0]

    n = int(input())
    print(fmt % tuple(c1))
    koch(n, c1, c2)
    print(fmt % tuple(c2)) main
from math import sqrt

def koch(n, c1, c2):
    if n == 0:
        return
    
    # 処理
    v = [c2[0] - c1[0], c2[1] - c1[1]]

    s = [c1[0] + v[0] / 3, c1[1] + v[1] / 3]
    t = [c1[0] + 2 * v[0] / 3, c1[1] + 2 * v[1] / 3]
    u = [c1[0] + v[0]/2 - v[1] * sqrt(3) / 6, c1[1] + v[1]/2 + v[0] * sqrt(3) / 6]

    koch(n-1, c1, s)
    print(" ".join(map(str, s)))
    koch(n-1, s, u)
    print(" ".join(map(str, u)))
    koch(n-1, u, t)
    print(" ".join(map(str, t)))
    koch(n-1, t, c2)


    

def main():
    fmt = "%.8f %.8f"
    q3 = sqrt(3)

    c1 = [0, 0]
    c2 = [100, 0]

    n = int(input())
    print(fmt % tuple(c1))
    koch(n, c1, c2)
    print(fmt % tuple(c2))

main()
