import math
angle = math.pi / 3 # 60度

def koch(p1, p2, n):
    if n == 0:
        return

    s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3)
    t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3)
    u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1])

    koch(p1, s, n-1)
    print("{0:.8f} {1:.8f}".format(s[0], s[1]))
    koch(s, u, n-1)
    print("{0:.8f} {1:.8f}".format(u[0], u[1]))
    koch(u, t, n-1)
    print("{0:.8f} {1:.8f}".format(t[0], t[1]))
    koch(t, p2, n-1)

n = int(input())
print("{0:.8f} {1:.8f}".format(0.0, 0.0))
koch((0.0, 0.0), (100.0, 0.0), n)
print("{0:.8f} {1:.8f}".format(100.0, 0.0)) import math math angle = math.pi / 3 angle math.pi / 3 math.pi math pi 3 def koch(p1, p2, n):
    if n == 0:
        return

    s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3)
    t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3)
    u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1])

    koch(p1, s, n-1)
    print("{0:.8f} {1:.8f}".format(s[0], s[1]))
    koch(s, u, n-1)
    print("{0:.8f} {1:.8f}".format(u[0], u[1]))
    koch(u, t, n-1)
    print("{0:.8f} {1:.8f}".format(t[0], t[1]))
    koch(t, p2, n-1) koch if n == 0:
        return

     n == 0 n 0 return s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3) s ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3) (p1[0] * 2 + p2[0]) / 3 p1[0] * 2 + p2[0] p1[0] * 2 p1[0] p1 0 2 p2[0] p2 0 3 (p1[1] * 2 + p2[1]) / 3 p1[1] * 2 + p2[1] p1[1] * 2 p1[1] p1 1 2 p2[1] p2 1 3 t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3) t ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3) (p1[0] + p2[0] * 2) / 3 p1[0] + p2[0] * 2 p1[0] p1 0 p2[0] * 2 p2[0] p2 0 2 3 (p1[1] + p2[1] * 2) / 3 p1[1] + p2[1] * 2 p1[1] p1 1 p2[1] * 2 p2[1] p2 1 2 3 u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1]) u ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1]) (t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0] (t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) (t[0] - s[0]) * math.cos(angle) t[0] - s[0] t[0] t 0 s[0] s 0 math.cos(angle) math.cos math cos angle (t[1] - s[1]) * math.sin(angle) t[1] - s[1] t[1] t 1 s[1] s 1 math.sin(angle) math.sin math sin angle s[0] s 0 (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1] (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) (t[0] - s[0]) * math.sin(angle) t[0] - s[0] t[0] t 0 s[0] s 0 math.sin(angle) math.sin math sin angle (t[1] - s[1]) * math.cos(angle) t[1] - s[1] t[1] t 1 s[1] s 1 math.cos(angle) math.cos math cos angle s[1] s 1 koch(p1, s, n-1) koch p1 s n-1 n 1 print("{0:.8f} {1:.8f}".format(s[0], s[1])) print "{0:.8f} {1:.8f}".format(s[0], s[1]) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format s[0] s 0 s[1] s 1 koch(s, u, n-1) koch s u n-1 n 1 print("{0:.8f} {1:.8f}".format(u[0], u[1])) print "{0:.8f} {1:.8f}".format(u[0], u[1]) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format u[0] u 0 u[1] u 1 koch(u, t, n-1) koch u t n-1 n 1 print("{0:.8f} {1:.8f}".format(t[0], t[1])) print "{0:.8f} {1:.8f}".format(t[0], t[1]) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format t[0] t 0 t[1] t 1 koch(t, p2, n-1) koch t p2 n-1 n 1 p1 p1 p2 p2 n n n = int(input()) n int(input()) int input() input print("{0:.8f} {1:.8f}".format(0.0, 0.0)) print "{0:.8f} {1:.8f}".format(0.0, 0.0) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format 0.0 0.0 koch((0.0, 0.0), (100.0, 0.0), n) koch (0.0, 0.0) 0.0 0.0 (100.0, 0.0) 100.0 0.0 n print("{0:.8f} {1:.8f}".format(100.0, 0.0)) print "{0:.8f} {1:.8f}".format(100.0, 0.0) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format 100.0 0.0 angle = math.pi / 3 math.pi / 3 angle n = int(input()) int(input()) n def koch(p1, p2, n):
    if n == 0:
        return

    s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3)
    t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3)
    u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1])

    koch(p1, s, n-1)
    print("{0:.8f} {1:.8f}".format(s[0], s[1]))
    koch(s, u, n-1)
    print("{0:.8f} {1:.8f}".format(u[0], u[1]))
    koch(u, t, n-1)
    print("{0:.8f} {1:.8f}".format(t[0], t[1]))
    koch(t, p2, n-1) def koch(p1, p2, n):
    if n == 0:
        return

    s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3)
    t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3)
    u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1])

    koch(p1, s, n-1)
    print("{0:.8f} {1:.8f}".format(s[0], s[1]))
    koch(s, u, n-1)
    print("{0:.8f} {1:.8f}".format(u[0], u[1]))
    koch(u, t, n-1)
    print("{0:.8f} {1:.8f}".format(t[0], t[1]))
    koch(t, p2, n-1) koch
import math
angle = math.pi / 3 # 60度

def koch(p1, p2, n):
    if n == 0:
        return

    s = ((p1[0] * 2 + p2[0]) / 3, (p1[1] * 2 + p2[1]) / 3)
    t = ((p1[0] + p2[0] * 2) / 3, (p1[1] + p2[1] * 2) / 3)
    u = ((t[0] - s[0]) * math.cos(angle) - (t[1] - s[1]) * math.sin(angle) + s[0], \
        (t[0] - s[0]) * math.sin(angle) + (t[1] - s[1]) * math.cos(angle) + s[1])

    koch(p1, s, n-1)
    print("{0:.8f} {1:.8f}".format(s[0], s[1]))
    koch(s, u, n-1)
    print("{0:.8f} {1:.8f}".format(u[0], u[1]))
    koch(u, t, n-1)
    print("{0:.8f} {1:.8f}".format(t[0], t[1]))
    koch(t, p2, n-1)

n = int(input())
print("{0:.8f} {1:.8f}".format(0.0, 0.0))
koch((0.0, 0.0), (100.0, 0.0), n)
print("{0:.8f} {1:.8f}".format(100.0, 0.0))
