def koch_curve(n, x1, y1, x2, y2):
    if n == 0:
        return [(x1, y1)]
    s_x = (2 * x1 + x2) / 3
    s_y = (2 * y1 + y2) / 3
    t_x = (x1 + 2 * x2) / 3
    t_y = (y1 + 2 * y2) / 3
    # 回転行列を用いて
    u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x
    u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y
    ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2)
    return ret
for x, y in koch_curve(int(input()), 0, 0, 100, 0):
    print('{:.8f} {:.8f}'.format(x, y))
print('{:.8f} {:.8f}'.format(100, 0)) def koch_curve(n, x1, y1, x2, y2):
    if n == 0:
        return [(x1, y1)]
    s_x = (2 * x1 + x2) / 3
    s_y = (2 * y1 + y2) / 3
    t_x = (x1 + 2 * x2) / 3
    t_y = (y1 + 2 * y2) / 3
    # 回転行列を用いて
    u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x
    u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y
    ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2)
    return ret koch_curve if n == 0:
        return [(x1, y1)]
     n == 0 n 0 return [(x1, y1)] [(x1, y1)] (x1, y1) x1 y1 s_x = (2 * x1 + x2) / 3 s_x (2 * x1 + x2) / 3 2 * x1 + x2 2 * x1 2 x1 x2 3 s_y = (2 * y1 + y2) / 3 s_y (2 * y1 + y2) / 3 2 * y1 + y2 2 * y1 2 y1 y2 3 t_x = (x1 + 2 * x2) / 3 t_x (x1 + 2 * x2) / 3 x1 + 2 * x2 x1 2 * x2 2 x2 3 t_y = (y1 + 2 * y2) / 3 t_y (y1 + 2 * y2) / 3 y1 + 2 * y2 y1 2 * y2 2 y2 3 u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x u_x (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) (t_x - s_x) * .5 t_x - s_x t_x s_x .5 (t_y - s_y) * (3 ** .5 / 2) t_y - s_y t_y s_y 3 ** .5 / 2 3 ** .5 3 .5 2 s_x u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y u_y (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5 (t_x - s_x) * (3 ** .5 / 2) t_x - s_x t_x s_x 3 ** .5 / 2 3 ** .5 3 .5 2 (t_y - s_y) * .5 t_y - s_y t_y s_y .5 s_y ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2) ret koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2) koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) koch_curve(n - 1, x1, y1, s_x, s_y) koch_curve n - 1 n 1 x1 y1 s_x s_y koch_curve(n - 1, s_x, s_y, u_x, u_y) koch_curve n - 1 n 1 s_x s_y u_x u_y koch_curve(n - 1, u_x, u_y, t_x, t_y) koch_curve n - 1 n 1 u_x u_y t_x t_y koch_curve(n - 1, t_x, t_y, x2, y2) koch_curve n - 1 n 1 t_x t_y x2 y2 return ret ret n n x1 x1 y1 y1 x2 x2 y2 y2 for x, y in koch_curve(int(input()), 0, 0, 100, 0):
    print('{:.8f} {:.8f}'.format(x, y)) x y koch_curve(int(input()), 0, 0, 100, 0) koch_curve int(input()) int input() input 0 0 100 0 print('{:.8f} {:.8f}'.format(x, y)) print '{:.8f} {:.8f}'.format(x, y) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format x y print('{:.8f} {:.8f}'.format(100, 0)) print '{:.8f} {:.8f}'.format(100, 0) '{:.8f} {:.8f}'.format '{:.8f} {:.8f}' format 100 0 def koch_curve(n, x1, y1, x2, y2):
    if n == 0:
        return [(x1, y1)]
    s_x = (2 * x1 + x2) / 3
    s_y = (2 * y1 + y2) / 3
    t_x = (x1 + 2 * x2) / 3
    t_y = (y1 + 2 * y2) / 3
    # 回転行列を用いて
    u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x
    u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y
    ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2)
    return ret def koch_curve(n, x1, y1, x2, y2):
    if n == 0:
        return [(x1, y1)]
    s_x = (2 * x1 + x2) / 3
    s_y = (2 * y1 + y2) / 3
    t_x = (x1 + 2 * x2) / 3
    t_y = (y1 + 2 * y2) / 3
    # 回転行列を用いて
    u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x
    u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y
    ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2)
    return ret koch_curve
def koch_curve(n, x1, y1, x2, y2):
    if n == 0:
        return [(x1, y1)]
    s_x = (2 * x1 + x2) / 3
    s_y = (2 * y1 + y2) / 3
    t_x = (x1 + 2 * x2) / 3
    t_y = (y1 + 2 * y2) / 3
    # 回転行列を用いて
    u_x = (t_x - s_x) * .5 - (t_y - s_y) * (3 ** .5 / 2) + s_x
    u_y = (t_x - s_x) * (3 ** .5 / 2) + (t_y - s_y) * .5  + s_y
    ret = koch_curve(n - 1, x1, y1, s_x, s_y) + \
        koch_curve(n - 1, s_x, s_y, u_x, u_y) + \
        koch_curve(n - 1, u_x, u_y, t_x, t_y) + \
        koch_curve(n - 1, t_x, t_y, x2, y2)
    return ret
for x, y in koch_curve(int(input()), 0, 0, 100, 0):
    print('{:.8f} {:.8f}'.format(x, y))
print('{:.8f} {:.8f}'.format(100, 0))
