import sys, os, math, bisect, itertools, collections, heapq, queue

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def koch(N, ax, ay, bx, by):
    if N == 0: return

    # 度をラジアンに変換
    radians = math.radians(60)
    # 線分を3等分する、
    # 座標sと座標tの位置を求める
    sx = (2 * ax + bx) / 3
    sy = (2 * ay + by) / 3
    tx = (ax + 2 * bx) / 3
    ty = (ay + 2 * by) / 3

    # 座標sと座標tから正三角形となる座標uを求める
    ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx
    uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy

    # 座標aと座標sのコッホ曲線を求める
    koch(N - 1, ax, ay, sx, sy)
    print('{:.08f} {:.08f}'.format(sx, sy))  # 座標s

    # 座標sと座標uのコッホ曲線を求める
    koch(N - 1, sx, sy, ux, uy)
    print('{:.08f} {:.08f}'.format(ux, uy))  # 座標u

    # 座標uと座標tのコッホ曲線を求める
    koch(N - 1, ux, uy, tx, ty)
    print('{:.08f} {:.08f}'.format(tx, ty))  # 座標t

    # 座標tと座標bのコッホ曲線を求める
    koch(N - 1, tx, ty, bx, by)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('{:.08f} {:.08f}'.format(0, 0))  # 座標a
    koch(N, 0, 0, 100, 0)
    print('{:.08f} {:.08f}'.format(100, 0))  # 座標b


if __name__ == '__main__':
    main()
 import sys, os, math, bisect, itertools, collections, heapq, queue sys os math bisect itertools collections heapq queue sys.setrecursionlimit(10000000) sys.setrecursionlimit sys setrecursionlimit 10000000 ii = lambda: int(sys.stdin.buffer.readline().rstrip()) ii lambda: int(sys.stdin.buffer.readline().rstrip()) int(sys.stdin.buffer.readline().rstrip()) int sys.stdin.buffer.readline().rstrip() sys.stdin.buffer.readline().rstrip sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline rstrip il = lambda: list(map(int, sys.stdin.buffer.readline().split())) il lambda: list(map(int, sys.stdin.buffer.readline().split())) list(map(int, sys.stdin.buffer.readline().split())) list map(int, sys.stdin.buffer.readline().split()) map int sys.stdin.buffer.readline().split() sys.stdin.buffer.readline().split sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline split fl = lambda: list(map(float, sys.stdin.buffer.readline().split())) fl lambda: list(map(float, sys.stdin.buffer.readline().split())) list(map(float, sys.stdin.buffer.readline().split())) list map(float, sys.stdin.buffer.readline().split()) map float sys.stdin.buffer.readline().split() sys.stdin.buffer.readline().split sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline split int(sys.stdin.buffer.readline().rstrip()) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) int(sys.stdin.buffer.readline().rstrip()) int sys.stdin.buffer.readline().rstrip() sys.stdin.buffer.readline().rstrip sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline rstrip iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)] iln lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)] [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)] n iss = lambda: sys.stdin.buffer.readline().decode().rstrip() iss lambda: sys.stdin.buffer.readline().decode().rstrip() sys.stdin.buffer.readline().decode().rstrip() sys.stdin.buffer.readline().decode().rstrip sys.stdin.buffer.readline().decode() sys.stdin.buffer.readline().decode sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline decode rstrip sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split())) sl lambda: list(map(str, sys.stdin.buffer.readline().decode().split())) list(map(str, sys.stdin.buffer.readline().decode().split())) list map(str, sys.stdin.buffer.readline().decode().split()) map str sys.stdin.buffer.readline().decode().split() sys.stdin.buffer.readline().decode().split sys.stdin.buffer.readline().decode() sys.stdin.buffer.readline().decode sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline decode split sys.stdin.buffer.readline().decode().rstrip() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) sys.stdin.buffer.readline().decode().rstrip() sys.stdin.buffer.readline().decode().rstrip sys.stdin.buffer.readline().decode() sys.stdin.buffer.readline().decode sys.stdin.buffer.readline() sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline decode rstrip isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)] isn lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)] [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)] n lcm = lambda x, y: (x * y) // math.gcd(x, y) lcm lambda x, y: (x * y) // math.gcd(x, y) (x * y) // math.gcd(x, y) x * y x y math.gcd(x, y) math.gcd math gcd x y x y MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 MAX = float('inf') MAX float('inf') float 'inf' def koch(N, ax, ay, bx, by):
    if N == 0: return

    # 度をラジアンに変換
    radians = math.radians(60)
    # 線分を3等分する、
    # 座標sと座標tの位置を求める
    sx = (2 * ax + bx) / 3
    sy = (2 * ay + by) / 3
    tx = (ax + 2 * bx) / 3
    ty = (ay + 2 * by) / 3

    # 座標sと座標tから正三角形となる座標uを求める
    ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx
    uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy

    # 座標aと座標sのコッホ曲線を求める
    koch(N - 1, ax, ay, sx, sy)
    print('{:.08f} {:.08f}'.format(sx, sy))  # 座標s

    # 座標sと座標uのコッホ曲線を求める
    koch(N - 1, sx, sy, ux, uy)
    print('{:.08f} {:.08f}'.format(ux, uy))  # 座標u

    # 座標uと座標tのコッホ曲線を求める
    koch(N - 1, ux, uy, tx, ty)
    print('{:.08f} {:.08f}'.format(tx, ty))  # 座標t

    # 座標tと座標bのコッホ曲線を求める
    koch(N - 1, tx, ty, bx, by) koch if N == 0: return

    # 度をラジアンに変換
     N == 0 N 0 radians = math.radians(60) radians math.radians(60) math.radians math radians 60 sx = (2 * ax + bx) / 3 sx (2 * ax + bx) / 3 2 * ax + bx 2 * ax 2 ax bx 3 sy = (2 * ay + by) / 3 sy (2 * ay + by) / 3 2 * ay + by 2 * ay 2 ay by 3 tx = (ax + 2 * bx) / 3 tx (ax + 2 * bx) / 3 ax + 2 * bx ax 2 * bx 2 bx 3 ty = (ay + 2 * by) / 3 ty (ay + 2 * by) / 3 ay + 2 * by ay 2 * by 2 by 3 ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx ux (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) (tx - sx) * math.cos(radians) tx - sx tx sx math.cos(radians) math.cos math cos radians (ty - sy) * math.sin(radians) ty - sy ty sy math.sin(radians) math.sin math sin radians sx uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy uy (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) (tx - sx) * math.sin(radians) tx - sx tx sx math.sin(radians) math.sin math sin radians (ty - sy) * math.cos(radians) ty - sy ty sy math.cos(radians) math.cos math cos radians sy koch(N - 1, ax, ay, sx, sy) koch N - 1 N 1 ax ay sx sy print('{:.08f} {:.08f}'.format(sx, sy)) print '{:.08f} {:.08f}'.format(sx, sy) '{:.08f} {:.08f}'.format '{:.08f} {:.08f}' format sx sy koch(N - 1, sx, sy, ux, uy) koch N - 1 N 1 sx sy ux uy print('{:.08f} {:.08f}'.format(ux, uy)) print '{:.08f} {:.08f}'.format(ux, uy) '{:.08f} {:.08f}'.format '{:.08f} {:.08f}' format ux uy koch(N - 1, ux, uy, tx, ty) koch N - 1 N 1 ux uy tx ty print('{:.08f} {:.08f}'.format(tx, ty)) print '{:.08f} {:.08f}'.format(tx, ty) '{:.08f} {:.08f}'.format '{:.08f} {:.08f}' format tx ty koch(N - 1, tx, ty, bx, by) koch N - 1 N 1 tx ty bx by N N ax ax ay ay bx bx by by def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('{:.08f} {:.08f}'.format(0, 0))  # 座標a
    koch(N, 0, 0, 100, 0)
    print('{:.08f} {:.08f}'.format(100, 0))  # 座標b main if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

     os.getenv("LOCAL") os.getenv os getenv "LOCAL" sys.stdin = open("input.txt", "r") sys.stdin sys stdin open("input.txt", "r") open "input.txt" "r" N = ii() N ii() ii print('{:.08f} {:.08f}'.format(0, 0)) print '{:.08f} {:.08f}'.format(0, 0) '{:.08f} {:.08f}'.format '{:.08f} {:.08f}' format 0 0 koch(N, 0, 0, 100, 0) koch N 0 0 100 0 print('{:.08f} {:.08f}'.format(100, 0)) print '{:.08f} {:.08f}'.format(100, 0) '{:.08f} {:.08f}'.format '{:.08f} {:.08f}' format 100 0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main il = lambda: list(map(int, sys.stdin.buffer.readline().split())) lambda: list(map(int, sys.stdin.buffer.readline().split())) il fl = lambda: list(map(float, sys.stdin.buffer.readline().split())) lambda: list(map(float, sys.stdin.buffer.readline().split())) fl lcm = lambda x, y: (x * y) // math.gcd(x, y) lambda x, y: (x * y) // math.gcd(x, y) lcm isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)] lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)] isn ii = lambda: int(sys.stdin.buffer.readline().rstrip()) lambda: int(sys.stdin.buffer.readline().rstrip()) ii MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD iss = lambda: sys.stdin.buffer.readline().decode().rstrip() lambda: sys.stdin.buffer.readline().decode().rstrip() iss MAX = float('inf') float('inf') MAX def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('{:.08f} {:.08f}'.format(0, 0))  # 座標a
    koch(N, 0, 0, 100, 0)
    print('{:.08f} {:.08f}'.format(100, 0))  # 座標b def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('{:.08f} {:.08f}'.format(0, 0))  # 座標a
    koch(N, 0, 0, 100, 0)
    print('{:.08f} {:.08f}'.format(100, 0))  # 座標b main iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)] lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)] iln sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split())) lambda: list(map(str, sys.stdin.buffer.readline().decode().split())) sl def koch(N, ax, ay, bx, by):
    if N == 0: return

    # 度をラジアンに変換
    radians = math.radians(60)
    # 線分を3等分する、
    # 座標sと座標tの位置を求める
    sx = (2 * ax + bx) / 3
    sy = (2 * ay + by) / 3
    tx = (ax + 2 * bx) / 3
    ty = (ay + 2 * by) / 3

    # 座標sと座標tから正三角形となる座標uを求める
    ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx
    uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy

    # 座標aと座標sのコッホ曲線を求める
    koch(N - 1, ax, ay, sx, sy)
    print('{:.08f} {:.08f}'.format(sx, sy))  # 座標s

    # 座標sと座標uのコッホ曲線を求める
    koch(N - 1, sx, sy, ux, uy)
    print('{:.08f} {:.08f}'.format(ux, uy))  # 座標u

    # 座標uと座標tのコッホ曲線を求める
    koch(N - 1, ux, uy, tx, ty)
    print('{:.08f} {:.08f}'.format(tx, ty))  # 座標t

    # 座標tと座標bのコッホ曲線を求める
    koch(N - 1, tx, ty, bx, by) def koch(N, ax, ay, bx, by):
    if N == 0: return

    # 度をラジアンに変換
    radians = math.radians(60)
    # 線分を3等分する、
    # 座標sと座標tの位置を求める
    sx = (2 * ax + bx) / 3
    sy = (2 * ay + by) / 3
    tx = (ax + 2 * bx) / 3
    ty = (ay + 2 * by) / 3

    # 座標sと座標tから正三角形となる座標uを求める
    ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx
    uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy

    # 座標aと座標sのコッホ曲線を求める
    koch(N - 1, ax, ay, sx, sy)
    print('{:.08f} {:.08f}'.format(sx, sy))  # 座標s

    # 座標sと座標uのコッホ曲線を求める
    koch(N - 1, sx, sy, ux, uy)
    print('{:.08f} {:.08f}'.format(ux, uy))  # 座標u

    # 座標uと座標tのコッホ曲線を求める
    koch(N - 1, ux, uy, tx, ty)
    print('{:.08f} {:.08f}'.format(tx, ty))  # 座標t

    # 座標tと座標bのコッホ曲線を求める
    koch(N - 1, tx, ty, bx, by) koch
import sys, os, math, bisect, itertools, collections, heapq, queue

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def koch(N, ax, ay, bx, by):
    if N == 0: return

    # 度をラジアンに変換
    radians = math.radians(60)
    # 線分を3等分する、
    # 座標sと座標tの位置を求める
    sx = (2 * ax + bx) / 3
    sy = (2 * ay + by) / 3
    tx = (ax + 2 * bx) / 3
    ty = (ay + 2 * by) / 3

    # 座標sと座標tから正三角形となる座標uを求める
    ux = (tx - sx) * math.cos(radians) - (ty - sy) * math.sin(radians) + sx
    uy = (tx - sx) * math.sin(radians) + (ty - sy) * math.cos(radians) + sy

    # 座標aと座標sのコッホ曲線を求める
    koch(N - 1, ax, ay, sx, sy)
    print('{:.08f} {:.08f}'.format(sx, sy))  # 座標s

    # 座標sと座標uのコッホ曲線を求める
    koch(N - 1, sx, sy, ux, uy)
    print('{:.08f} {:.08f}'.format(ux, uy))  # 座標u

    # 座標uと座標tのコッホ曲線を求める
    koch(N - 1, ux, uy, tx, ty)
    print('{:.08f} {:.08f}'.format(tx, ty))  # 座標t

    # 座標tと座標bのコッホ曲線を求める
    koch(N - 1, tx, ty, bx, by)


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    print('{:.08f} {:.08f}'.format(0, 0))  # 座標a
    koch(N, 0, 0, 100, 0)
    print('{:.08f} {:.08f}'.format(100, 0))  # 座標b


if __name__ == '__main__':
    main()

