def print8f(xy):
    from decimal import Decimal, ROUND_HALF_UP
    acc = Decimal("0.00000001")
    x, y = xy
    x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP)
    print("{:.8f} {:.8f}".format(x, y))


def kochCurve(p1p2, n, ang):
    from math import sin, cos, radians, sqrt
    if n == 0:
        print8f(p1p2[1])
        return
    p1, p2 = p1p2
    xd3 = (p2[0] - p1[0]) / 3
    yd3 = (p2[1] - p1[1]) / 3
    s = [p1[0] + xd3, p1[1] + yd3]
    t = [p2[0] - xd3, p2[1] - yd3]
    st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2)
    u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st]

    kochCurve([p1, s], n - 1, ang)
    kochCurve([s, u], n - 1, ang + 60)
    kochCurve([u, t], n - 1, ang - 60)
    kochCurve([t, p2], n - 1, ang)


def resolve():
    n = int(input())
    p1p2 = [[0, 0], [100, 0]]
    print8f(p1p2[0])
    kochCurve(p1p2, n, 0)


resolve()
 def print8f(xy):
    from decimal import Decimal, ROUND_HALF_UP
    acc = Decimal("0.00000001")
    x, y = xy
    x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP)
    print("{:.8f} {:.8f}".format(x, y)) print8f from decimal import Decimal, ROUND_HALF_UP acc = Decimal("0.00000001") acc Decimal("0.00000001") Decimal "0.00000001" x, y = xy x xy y x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP) x Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP) (str(x)).quantize (str(x)) Decimal str(x) str x quantize acc rounding=ROUND_HALF_UP rounding ROUND_HALF_UP y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP) y Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP) (str(y)).quantize (str(y)) Decimal str(y) str y quantize acc rounding=ROUND_HALF_UP rounding ROUND_HALF_UP print("{:.8f} {:.8f}".format(x, y)) print "{:.8f} {:.8f}".format(x, y) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format x y xy xy def kochCurve(p1p2, n, ang):
    from math import sin, cos, radians, sqrt
    if n == 0:
        print8f(p1p2[1])
        return
    p1, p2 = p1p2
    xd3 = (p2[0] - p1[0]) / 3
    yd3 = (p2[1] - p1[1]) / 3
    s = [p1[0] + xd3, p1[1] + yd3]
    t = [p2[0] - xd3, p2[1] - yd3]
    st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2)
    u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st]

    kochCurve([p1, s], n - 1, ang)
    kochCurve([s, u], n - 1, ang + 60)
    kochCurve([u, t], n - 1, ang - 60)
    kochCurve([t, p2], n - 1, ang) kochCurve from math import sin, cos, radians, sqrt if n == 0:
        print8f(p1p2[1])
        return
     n == 0 n 0 print8f(p1p2[1]) print8f p1p2[1] p1p2 1 return p1, p2 = p1p2 p1 p1p2 p2 xd3 = (p2[0] - p1[0]) / 3 xd3 (p2[0] - p1[0]) / 3 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 3 yd3 = (p2[1] - p1[1]) / 3 yd3 (p2[1] - p1[1]) / 3 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 3 s = [p1[0] + xd3, p1[1] + yd3] s [p1[0] + xd3, p1[1] + yd3] p1[0] + xd3 p1[0] p1 0 xd3 p1[1] + yd3 p1[1] p1 1 yd3 t = [p2[0] - xd3, p2[1] - yd3] t [p2[0] - xd3, p2[1] - yd3] p2[0] - xd3 p2[0] p2 0 xd3 p2[1] - yd3 p2[1] p2 1 yd3 st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2) st sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2) sqrt (s[0] - t[0])**2 + (s[1] - t[1])**2 (s[0] - t[0])**2 s[0] - t[0] s[0] s 0 t[0] t 0 2 (s[1] - t[1])**2 s[1] - t[1] s[1] s 1 t[1] t 1 2 u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st] u [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st] s[0] + cos(radians(ang + 60)) * st s[0] s 0 cos(radians(ang + 60)) * st cos(radians(ang + 60)) cos radians(ang + 60) radians ang + 60 ang 60 st s[1] + sin(radians(ang + 60)) * st s[1] s 1 sin(radians(ang + 60)) * st sin(radians(ang + 60)) sin radians(ang + 60) radians ang + 60 ang 60 st kochCurve([p1, s], n - 1, ang) kochCurve [p1, s] p1 s n - 1 n 1 ang kochCurve([s, u], n - 1, ang + 60) kochCurve [s, u] s u n - 1 n 1 ang + 60 ang 60 kochCurve([u, t], n - 1, ang - 60) kochCurve [u, t] u t n - 1 n 1 ang - 60 ang 60 kochCurve([t, p2], n - 1, ang) kochCurve [t, p2] t p2 n - 1 n 1 ang p1p2 p1p2 n n ang ang def resolve():
    n = int(input())
    p1p2 = [[0, 0], [100, 0]]
    print8f(p1p2[0])
    kochCurve(p1p2, n, 0) resolve n = int(input()) n int(input()) int input() input p1p2 = [[0, 0], [100, 0]] p1p2 [[0, 0], [100, 0]] [0, 0] 0 0 [100, 0] 100 0 print8f(p1p2[0]) print8f p1p2[0] p1p2 0 kochCurve(p1p2, n, 0) kochCurve p1p2 n 0 resolve() resolve def resolve():
    n = int(input())
    p1p2 = [[0, 0], [100, 0]]
    print8f(p1p2[0])
    kochCurve(p1p2, n, 0) def resolve():
    n = int(input())
    p1p2 = [[0, 0], [100, 0]]
    print8f(p1p2[0])
    kochCurve(p1p2, n, 0) resolve def kochCurve(p1p2, n, ang):
    from math import sin, cos, radians, sqrt
    if n == 0:
        print8f(p1p2[1])
        return
    p1, p2 = p1p2
    xd3 = (p2[0] - p1[0]) / 3
    yd3 = (p2[1] - p1[1]) / 3
    s = [p1[0] + xd3, p1[1] + yd3]
    t = [p2[0] - xd3, p2[1] - yd3]
    st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2)
    u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st]

    kochCurve([p1, s], n - 1, ang)
    kochCurve([s, u], n - 1, ang + 60)
    kochCurve([u, t], n - 1, ang - 60)
    kochCurve([t, p2], n - 1, ang) def kochCurve(p1p2, n, ang):
    from math import sin, cos, radians, sqrt
    if n == 0:
        print8f(p1p2[1])
        return
    p1, p2 = p1p2
    xd3 = (p2[0] - p1[0]) / 3
    yd3 = (p2[1] - p1[1]) / 3
    s = [p1[0] + xd3, p1[1] + yd3]
    t = [p2[0] - xd3, p2[1] - yd3]
    st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2)
    u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st]

    kochCurve([p1, s], n - 1, ang)
    kochCurve([s, u], n - 1, ang + 60)
    kochCurve([u, t], n - 1, ang - 60)
    kochCurve([t, p2], n - 1, ang) kochCurve def print8f(xy):
    from decimal import Decimal, ROUND_HALF_UP
    acc = Decimal("0.00000001")
    x, y = xy
    x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP)
    print("{:.8f} {:.8f}".format(x, y)) def print8f(xy):
    from decimal import Decimal, ROUND_HALF_UP
    acc = Decimal("0.00000001")
    x, y = xy
    x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP)
    print("{:.8f} {:.8f}".format(x, y)) print8f
def print8f(xy):
    from decimal import Decimal, ROUND_HALF_UP
    acc = Decimal("0.00000001")
    x, y = xy
    x = Decimal(str(x)).quantize(acc, rounding=ROUND_HALF_UP)
    y = Decimal(str(y)).quantize(acc, rounding=ROUND_HALF_UP)
    print("{:.8f} {:.8f}".format(x, y))


def kochCurve(p1p2, n, ang):
    from math import sin, cos, radians, sqrt
    if n == 0:
        print8f(p1p2[1])
        return
    p1, p2 = p1p2
    xd3 = (p2[0] - p1[0]) / 3
    yd3 = (p2[1] - p1[1]) / 3
    s = [p1[0] + xd3, p1[1] + yd3]
    t = [p2[0] - xd3, p2[1] - yd3]
    st = sqrt((s[0] - t[0])**2 + (s[1] - t[1])**2)
    u = [s[0] + cos(radians(ang + 60)) * st,
         s[1] + sin(radians(ang + 60)) * st]

    kochCurve([p1, s], n - 1, ang)
    kochCurve([s, u], n - 1, ang + 60)
    kochCurve([u, t], n - 1, ang - 60)
    kochCurve([t, p2], n - 1, ang)


def resolve():
    n = int(input())
    p1p2 = [[0, 0], [100, 0]]
    print8f(p1p2[0])
    kochCurve(p1p2, n, 0)


resolve()

