from math import sqrt

from collections import deque



sin30 = 1 / 2

cos30 = sqrt(3) / 2

""" Direct length p1-u when p1-p2 is 1 """

p1_to_u = 1 / sqrt(3)





def koch(xy1, xy2):

    global sin30, cos30, p1_to_u

    (x1, y1) = xy1

    (x2, y2) = xy2

    dx, dy = x2 - x1, y2 - y1

    dx3, dy3 = dx / 3, dy / 3

    yield (x1 + dx3, y1 + dy3)

    xu, yu = dx * p1_to_u, dy * p1_to_u

    xu, yu = x1 + cos30 * xu - sin30 * yu, y1 + sin30 * xu + cos30 * yu

    yield (xu, yu)

    yield (x2 - dx3, y2 - dy3)





l = deque(((0.0, 0.0), (100.0, 0.0)))



for _ in range(int(eval(input()))):

    new_l = deque()

    prev_xy = l.popleft()

    for xy in l:

        new_l.append(prev_xy)

        new_l.extend(koch(prev_xy, xy))

        prev_xy = xy

    new_l.append(prev_xy)

    l = new_l



for xy in l:

    print((*xy))
from math import sqrt



n = int(eval(input()))

sin60 = sqrt(3) / 2

cos60 = 1 / 2





def koch(x1, y1, x2, y2, depth):

    global sin60, cos60, n

    if depth > n:

        return

    dx, dy = x2 - x1, y2 - y1

    dx3, dy3 = dx / 3, dy / 3

    xs, ys = x1 + dx3, y1 + dy3

    xt, yt = x2 - dx3, y2 - dy3

    xu, yu = xs + cos60 * dx3 - sin60 * dy3, ys + sin60 * dx3 + cos60 * dy3

    depth += 1

    for xy in koch(x1, y1, xs, ys, depth):

        yield xy

    yield (xs, ys)

    for xy in koch(xs, ys, xu, yu, depth):

        yield xy

    yield (xu, yu)

    for xy in koch(xu, yu, xt, yt, depth):

        yield xy

    yield (xt, yt)

    for xy in koch(xt, yt, x2, y2, depth):

        yield xy





print((0.0, 0.0))

for xy in koch(0.0, 0.0, 100.0, 0.0, 1):

    print((*xy))

print((100.0, 0.0))
from math import sqrt
from collections import deque

sin30 = 1 / 2
cos30 = sqrt(3) / 2
""" Direct length p1-u when p1-p2 is 1 """
p1_to_u = 1 / sqrt(3)


def koch(xy1, xy2):
    global sin30, cos30, p1_to_u
    (x1, y1) = xy1
    (x2, y2) = xy2
    dx, dy = x2 - x1, y2 - y1
    dx3, dy3 = dx / 3, dy / 3
    yield (x1 + dx3, y1 + dy3)
    xu, yu = dx * p1_to_u, dy * p1_to_u
    xu, yu = x1 + cos30 * xu - sin30 * yu, y1 + sin30 * xu + cos30 * yu
    yield (xu, yu)
    yield (x2 - dx3, y2 - dy3)


l = deque(((0.0, 0.0), (100.0, 0.0)))
for _ in range(int(eval(input()))):
    new_l = deque()
    prev_xy = l.popleft()
    for xy in l:
        new_l.append(prev_xy)
        new_l.extend(koch(prev_xy, xy))
        prev_xy = xy
    new_l.append(prev_xy)
    l = new_l
for xy in l:
    print((*xy))

from math import sqrt

n = int(eval(input()))
sin60 = sqrt(3) / 2
cos60 = 1 / 2


def koch(x1, y1, x2, y2, depth):
    global sin60, cos60, n
    if depth > n:
        return
    dx, dy = x2 - x1, y2 - y1
    dx3, dy3 = dx / 3, dy / 3
    xs, ys = x1 + dx3, y1 + dy3
    xt, yt = x2 - dx3, y2 - dy3
    xu, yu = xs + cos60 * dx3 - sin60 * dy3, ys + sin60 * dx3 + cos60 * dy3
    depth += 1
    for xy in koch(x1, y1, xs, ys, depth):
        yield xy
    yield (xs, ys)
    for xy in koch(xs, ys, xu, yu, depth):
        yield xy
    yield (xu, yu)
    for xy in koch(xu, yu, xt, yt, depth):
        yield xy
    yield (xt, yt)
    for xy in koch(xt, yt, x2, y2, depth):
        yield xy


print((0.0, 0.0))
for xy in koch(0.0, 0.0, 100.0, 0.0, 1):
    print((*xy))
print((100.0, 0.0))

-from collections import deque -sin30 = 1 / 2 -cos30 = sqrt(3) / 2 -""" Direct length p1-u when p1-p2 is 1 """ -p1_to_u = 1 / sqrt(3) +n = int(eval(input())) +sin60 = sqrt(3) / 2 +cos60 = 1 / 2 -def koch(xy1, xy2): -    global sin30, cos30, p1_to_u -    (x1, y1) = xy1 -    (x2, y2) = xy2 +def koch(x1, y1, x2, y2, depth): +    global sin60, cos60, n +    if depth > n: +        return -    yield (x1 + dx3, y1 + dy3) -    xu, yu = dx * p1_to_u, dy * p1_to_u -    xu, yu = x1 + cos30 * xu - sin30 * yu, y1 + sin30 * xu + cos30 * yu +    xs, ys = x1 + dx3, y1 + dy3 +    xt, yt = x2 - dx3, y2 - dy3 +    xu, yu = xs + cos60 * dx3 - sin60 * dy3, ys + sin60 * dx3 + cos60 * dy3 +    depth += 1 +    for xy in koch(x1, y1, xs, ys, depth): +        yield xy +    yield (xs, ys) +    for xy in koch(xs, ys, xu, yu, depth): +        yield xy -    yield (x2 - dx3, y2 - dy3) +    for xy in koch(xu, yu, xt, yt, depth): +        yield xy +    yield (xt, yt) +    for xy in koch(xt, yt, x2, y2, depth): +        yield xy -l = deque(((0.0, 0.0), (100.0, 0.0))) -for _ in range(int(eval(input()))): -    new_l = deque() -    prev_xy = l.popleft() -    for xy in l: -        new_l.append(prev_xy) -        new_l.extend(koch(prev_xy, xy)) -        prev_xy = xy -    new_l.append(prev_xy) -    l = new_l -for xy in l: +print((0.0, 0.0)) +for xy in koch(0.0, 0.0, 100.0, 0.0, 1): +print((100.0, 0.0))