import math

c60 = math.cos(math.radians(60))
s60 = math.sin(math.radians(60))

def koch(d, p1, p2):
    """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """
    if d == 0:
        return

    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + 2 * p2[0]) / 3
    ty = (p1[1] + 2 * p2[1]) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c60 - dy * s60 + sx
    uy = dx * s60 + dy * c60 + sy

    koch(d - 1, p1, (sx, sy))
    print("{0:.8f} {1:.8f}".format(sx, sy))

    koch(d - 1, (sx, sy), (ux, uy))
    print("{0:.8f} {1:.8f}".format(ux, uy))

    koch(d - 1, (ux, uy), (tx, ty))
    print("{0:.8f} {1:.8f}".format(tx, ty))

    koch(d - 1, (tx, ty), p2)


n = int(input())

ax = 0
ay = 0

bx = 100
by = 0

print("{0:.8f} {1:.8f}".format(ax, ay))
koch(n, (ax, ay), (bx, by))
print("{0:.8f} {1:.8f}".format(bx, by)) import math math c60 = math.cos(math.radians(60)) c60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s60 = math.sin(math.radians(60)) s60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 def koch(d, p1, p2):
    """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """
    if d == 0:
        return

    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + 2 * p2[0]) / 3
    ty = (p1[1] + 2 * p2[1]) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c60 - dy * s60 + sx
    uy = dx * s60 + dy * c60 + sy

    koch(d - 1, p1, (sx, sy))
    print("{0:.8f} {1:.8f}".format(sx, sy))

    koch(d - 1, (sx, sy), (ux, uy))
    print("{0:.8f} {1:.8f}".format(ux, uy))

    koch(d - 1, (ux, uy), (tx, ty))
    print("{0:.8f} {1:.8f}".format(tx, ty))

    koch(d - 1, (tx, ty), p2) koch """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """ if d == 0:
        return

     d == 0 d 0 return sx = (2 * p1[0] + p2[0]) / 3 sx (2 * p1[0] + p2[0]) / 3 2 * p1[0] + p2[0] 2 * p1[0] 2 p1[0] p1 0 p2[0] p2 0 3 sy = (2 * p1[1] + p2[1]) / 3 sy (2 * p1[1] + p2[1]) / 3 2 * p1[1] + p2[1] 2 * p1[1] 2 p1[1] p1 1 p2[1] p2 1 3 tx = (p1[0] + 2 * p2[0]) / 3 tx (p1[0] + 2 * p2[0]) / 3 p1[0] + 2 * p2[0] p1[0] p1 0 2 * p2[0] 2 p2[0] p2 0 3 ty = (p1[1] + 2 * p2[1]) / 3 ty (p1[1] + 2 * p2[1]) / 3 p1[1] + 2 * p2[1] p1[1] p1 1 2 * p2[1] 2 p2[1] p2 1 3 dx = tx - sx dx tx - sx tx sx dy = ty - sy dy ty - sy ty sy ux = dx * c60 - dy * s60 + sx ux dx * c60 - dy * s60 + sx dx * c60 - dy * s60 dx * c60 dx c60 dy * s60 dy s60 sx uy = dx * s60 + dy * c60 + sy uy dx * s60 + dy * c60 + sy dx * s60 + dy * c60 dx * s60 dx s60 dy * c60 dy c60 sy koch(d - 1, p1, (sx, sy)) koch d - 1 d 1 p1 (sx, sy) sx sy print("{0:.8f} {1:.8f}".format(sx, sy)) print "{0:.8f} {1:.8f}".format(sx, sy) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format sx sy koch(d - 1, (sx, sy), (ux, uy)) koch d - 1 d 1 (sx, sy) sx sy (ux, uy) ux uy print("{0:.8f} {1:.8f}".format(ux, uy)) print "{0:.8f} {1:.8f}".format(ux, uy) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format ux uy koch(d - 1, (ux, uy), (tx, ty)) koch d - 1 d 1 (ux, uy) ux uy (tx, ty) tx ty print("{0:.8f} {1:.8f}".format(tx, ty)) print "{0:.8f} {1:.8f}".format(tx, ty) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format tx ty koch(d - 1, (tx, ty), p2) koch d - 1 d 1 (tx, ty) tx ty p2 d d p1 p1 p2 p2 n = int(input()) n int(input()) int input() input ax = 0 ax 0 ay = 0 ay 0 bx = 100 bx 100 by = 0 by 0 print("{0:.8f} {1:.8f}".format(ax, ay)) print "{0:.8f} {1:.8f}".format(ax, ay) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format ax ay koch(n, (ax, ay), (bx, by)) koch n (ax, ay) ax ay (bx, by) bx by print("{0:.8f} {1:.8f}".format(bx, by)) print "{0:.8f} {1:.8f}".format(bx, by) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format bx by bx = 100 100 bx by = 0 0 by c60 = math.cos(math.radians(60)) math.cos(math.radians(60)) c60 s60 = math.sin(math.radians(60)) math.sin(math.radians(60)) s60 ay = 0 0 ay def koch(d, p1, p2):
    """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """
    if d == 0:
        return

    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + 2 * p2[0]) / 3
    ty = (p1[1] + 2 * p2[1]) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c60 - dy * s60 + sx
    uy = dx * s60 + dy * c60 + sy

    koch(d - 1, p1, (sx, sy))
    print("{0:.8f} {1:.8f}".format(sx, sy))

    koch(d - 1, (sx, sy), (ux, uy))
    print("{0:.8f} {1:.8f}".format(ux, uy))

    koch(d - 1, (ux, uy), (tx, ty))
    print("{0:.8f} {1:.8f}".format(tx, ty))

    koch(d - 1, (tx, ty), p2) def koch(d, p1, p2):
    """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """
    if d == 0:
        return

    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + 2 * p2[0]) / 3
    ty = (p1[1] + 2 * p2[1]) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c60 - dy * s60 + sx
    uy = dx * s60 + dy * c60 + sy

    koch(d - 1, p1, (sx, sy))
    print("{0:.8f} {1:.8f}".format(sx, sy))

    koch(d - 1, (sx, sy), (ux, uy))
    print("{0:.8f} {1:.8f}".format(ux, uy))

    koch(d - 1, (ux, uy), (tx, ty))
    print("{0:.8f} {1:.8f}".format(tx, ty))

    koch(d - 1, (tx, ty), p2) koch n = int(input()) int(input()) n ax = 0 0 ax
import math

c60 = math.cos(math.radians(60))
s60 = math.sin(math.radians(60))

def koch(d, p1, p2):
    """ Print the coordinates of the vertices of Koch Curve.
    d is the depth of recursion.
    p1, p2 are coordinates of end point of the initial state.
    """
    if d == 0:
        return

    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + 2 * p2[0]) / 3
    ty = (p1[1] + 2 * p2[1]) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c60 - dy * s60 + sx
    uy = dx * s60 + dy * c60 + sy

    koch(d - 1, p1, (sx, sy))
    print("{0:.8f} {1:.8f}".format(sx, sy))

    koch(d - 1, (sx, sy), (ux, uy))
    print("{0:.8f} {1:.8f}".format(ux, uy))

    koch(d - 1, (ux, uy), (tx, ty))
    print("{0:.8f} {1:.8f}".format(tx, ty))

    koch(d - 1, (tx, ty), p2)


n = int(input())

ax = 0
ay = 0

bx = 100
by = 0

print("{0:.8f} {1:.8f}".format(ax, ay))
koch(n, (ax, ay), (bx, by))
print("{0:.8f} {1:.8f}".format(bx, by))