from math import sin, cos, pi
def koch(px, py, qx, qy, n):
    if n == 0:
        return True
    sx = (2 * px + qx) / 3
    sy = (2 * py + qy) / 3
    tx = (px + 2 * qx) / 3
    ty = (py + 2 * qy) / 3
    ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3)
    uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3)
    koch(px, py, sx, sy, n - 1)
    print("{:.8f} {:.8f}".format(sx, sy))
    koch(sx, sy, ux, uy, n - 1)
    print("{:.8f} {:.8f}".format(ux, uy))
    koch(ux, uy, tx, ty, n - 1)
    print("{:.8f} {:.8f}".format(tx, ty))
    koch(tx, ty, qx, qy, n - 1)
n = int(input())
print("{:.8f} {:.8f}".format(0, 0))
koch(0, 0, 100, 0, n)
print("{:.8f} {:.8f}".format(100, 0)) from math import sin, cos, pi def koch(px, py, qx, qy, n):
    if n == 0:
        return True
    sx = (2 * px + qx) / 3
    sy = (2 * py + qy) / 3
    tx = (px + 2 * qx) / 3
    ty = (py + 2 * qy) / 3
    ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3)
    uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3)
    koch(px, py, sx, sy, n - 1)
    print("{:.8f} {:.8f}".format(sx, sy))
    koch(sx, sy, ux, uy, n - 1)
    print("{:.8f} {:.8f}".format(ux, uy))
    koch(ux, uy, tx, ty, n - 1)
    print("{:.8f} {:.8f}".format(tx, ty))
    koch(tx, ty, qx, qy, n - 1) koch if n == 0:
        return True
     n == 0 n 0 return True True sx = (2 * px + qx) / 3 sx (2 * px + qx) / 3 2 * px + qx 2 * px 2 px qx 3 sy = (2 * py + qy) / 3 sy (2 * py + qy) / 3 2 * py + qy 2 * py 2 py qy 3 tx = (px + 2 * qx) / 3 tx (px + 2 * qx) / 3 px + 2 * qx px 2 * qx 2 qx 3 ty = (py + 2 * qy) / 3 ty (py + 2 * qy) / 3 py + 2 * qy py 2 * qy 2 qy 3 ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3) ux sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3) sx + (tx - sx) * cos(pi / 3) sx (tx - sx) * cos(pi / 3) tx - sx tx sx cos(pi / 3) cos pi / 3 pi 3 (ty - sy) * sin(pi / 3) ty - sy ty sy sin(pi / 3) sin pi / 3 pi 3 uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3) uy sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3) sy + (tx - sx) * sin(pi / 3) sy (tx - sx) * sin(pi / 3) tx - sx tx sx sin(pi / 3) sin pi / 3 pi 3 (ty - sy) * cos(pi / 3) ty - sy ty sy cos(pi / 3) cos pi / 3 pi 3 koch(px, py, sx, sy, n - 1) koch px py sx sy n - 1 n 1 print("{:.8f} {:.8f}".format(sx, sy)) print "{:.8f} {:.8f}".format(sx, sy) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format sx sy koch(sx, sy, ux, uy, n - 1) koch sx sy ux uy n - 1 n 1 print("{:.8f} {:.8f}".format(ux, uy)) print "{:.8f} {:.8f}".format(ux, uy) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format ux uy koch(ux, uy, tx, ty, n - 1) koch ux uy tx ty n - 1 n 1 print("{:.8f} {:.8f}".format(tx, ty)) print "{:.8f} {:.8f}".format(tx, ty) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format tx ty koch(tx, ty, qx, qy, n - 1) koch tx ty qx qy n - 1 n 1 px px py py qx qx qy qy n n n = int(input()) n int(input()) int input() input print("{:.8f} {:.8f}".format(0, 0)) print "{:.8f} {:.8f}".format(0, 0) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format 0 0 koch(0, 0, 100, 0, n) koch 0 0 100 0 n print("{:.8f} {:.8f}".format(100, 0)) print "{:.8f} {:.8f}".format(100, 0) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format 100 0 def koch(px, py, qx, qy, n):
    if n == 0:
        return True
    sx = (2 * px + qx) / 3
    sy = (2 * py + qy) / 3
    tx = (px + 2 * qx) / 3
    ty = (py + 2 * qy) / 3
    ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3)
    uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3)
    koch(px, py, sx, sy, n - 1)
    print("{:.8f} {:.8f}".format(sx, sy))
    koch(sx, sy, ux, uy, n - 1)
    print("{:.8f} {:.8f}".format(ux, uy))
    koch(ux, uy, tx, ty, n - 1)
    print("{:.8f} {:.8f}".format(tx, ty))
    koch(tx, ty, qx, qy, n - 1) def koch(px, py, qx, qy, n):
    if n == 0:
        return True
    sx = (2 * px + qx) / 3
    sy = (2 * py + qy) / 3
    tx = (px + 2 * qx) / 3
    ty = (py + 2 * qy) / 3
    ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3)
    uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3)
    koch(px, py, sx, sy, n - 1)
    print("{:.8f} {:.8f}".format(sx, sy))
    koch(sx, sy, ux, uy, n - 1)
    print("{:.8f} {:.8f}".format(ux, uy))
    koch(ux, uy, tx, ty, n - 1)
    print("{:.8f} {:.8f}".format(tx, ty))
    koch(tx, ty, qx, qy, n - 1) koch n = int(input()) int(input()) n
from math import sin, cos, pi
def koch(px, py, qx, qy, n):
    if n == 0:
        return True
    sx = (2 * px + qx) / 3
    sy = (2 * py + qy) / 3
    tx = (px + 2 * qx) / 3
    ty = (py + 2 * qy) / 3
    ux = sx + (tx - sx) * cos(pi / 3) - (ty - sy) * sin(pi / 3)
    uy = sy + (tx - sx) * sin(pi / 3) + (ty - sy) * cos(pi / 3)
    koch(px, py, sx, sy, n - 1)
    print("{:.8f} {:.8f}".format(sx, sy))
    koch(sx, sy, ux, uy, n - 1)
    print("{:.8f} {:.8f}".format(ux, uy))
    koch(ux, uy, tx, ty, n - 1)
    print("{:.8f} {:.8f}".format(tx, ty))
    koch(tx, ty, qx, qy, n - 1)
n = int(input())
print("{:.8f} {:.8f}".format(0, 0))
koch(0, 0, 100, 0, n)
print("{:.8f} {:.8f}".format(100, 0))