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(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 from collections import deque sin30 = 1 / 2 sin30 1 / 2 1 2 cos30 = sqrt(3) / 2 cos30 sqrt(3) / 2 sqrt(3) sqrt 3 2 """ Direct length p1-u when p1-p2 is 1 """ p1_to_u = 1 / sqrt(3) p1_to_u 1 / sqrt(3) 1 sqrt(3) 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) koch global sin30, cos30, p1_to_u (x1, y1) = xy1 (x1, y1) x1 y1 xy1 (x2, y2) = xy2 (x2, y2) x2 y2 xy2 dx, dy = x2 - x1, y2 - y1 dx x2 - x1 x2 x1 dy y2 - y1 y2 y1 dx3, dy3 = dx / 3, dy / 3 dx3 dx / 3 dx 3 dy3 dy / 3 dy 3 yield (x1 + dx3, y1 + dy3) (x1 + dx3, y1 + dy3) x1 + dx3 x1 dx3 y1 + dy3 y1 dy3 xu, yu = dx * p1_to_u, dy * p1_to_u xu dx * p1_to_u dx p1_to_u yu dy * p1_to_u dy p1_to_u xu, yu = x1 + cos30 * xu - sin30 * yu, y1 + sin30 * xu + cos30 * yu xu x1 + cos30 * xu - sin30 * yu x1 + cos30 * xu x1 cos30 * xu cos30 xu sin30 * yu sin30 yu yu y1 + sin30 * xu + cos30 * yu y1 + sin30 * xu y1 sin30 * xu sin30 xu cos30 * yu cos30 yu yield (xu, yu) (xu, yu) xu yu yield (x2 - dx3, y2 - dy3) (x2 - dx3, y2 - dy3) x2 - dx3 x2 dx3 y2 - dy3 y2 dy3 xy1 xy1 xy2 xy2 l = deque(((0.0, 0.0), (100.0, 0.0))) l deque(((0.0, 0.0), (100.0, 0.0))) deque ((0.0, 0.0), (100.0, 0.0)) (0.0, 0.0) 0.0 0.0 (100.0, 0.0) 100.0 0.0 for _ in range(int(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 _ range(int(input())) range int(input()) int input() input new_l = deque() new_l deque() deque prev_xy = l.popleft() prev_xy l.popleft() l.popleft l popleft for xy in l:
        new_l.append(prev_xy)
        new_l.extend(koch(prev_xy, xy))
        prev_xy = xy
     xy l new_l.append(prev_xy) new_l.append new_l append prev_xy new_l.extend(koch(prev_xy, xy)) new_l.extend new_l extend koch(prev_xy, xy) koch prev_xy xy prev_xy = xy prev_xy xy new_l.append(prev_xy) new_l.append new_l append prev_xy l = new_l l new_l for xy in l:
    print(*xy) xy l print(*xy) print *xy xy sin30 = 1 / 2 1 / 2 sin30 l = new_l new_l l cos30 = sqrt(3) / 2 sqrt(3) / 2 cos30 prev_xy = l.popleft() l.popleft() prev_xy prev_xy = xy xy prev_xy p1_to_u = 1 / sqrt(3) 1 / sqrt(3) p1_to_u 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) 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) koch l = deque(((0.0, 0.0), (100.0, 0.0))) deque(((0.0, 0.0), (100.0, 0.0))) l new_l = deque() deque() new_l
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(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)