import math


def split3(a, b):
    s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3))
    t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3))
    return s, t


def rotate60(s, t):
    th = math.pi / 3
    u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1])
    u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1])
    return (u0, u1)


lst = [(0, 0), (100, 0)]
n = int(input())

for i in range(n):
    L = len(lst)
    new_lst = []
    for l in range(L - 1):
        left = lst[l]
        right = lst[l + 1]
        new_lst.append(left)
        s, t = split3(left, right)
        u = rotate60(s, t)
        new_lst.append(s)
        new_lst.append(u)
        new_lst.append(t)
    new_lst.append(right)
    lst = new_lst
for p in lst:
    print(*p)
 import math math def split3(a, b):
    s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3))
    t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3))
    return s, t split3 s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3)) s (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3)) a[0] * (2 / 3) + b[0] * (1 / 3) a[0] * (2 / 3) a[0] a 0 2 / 3 2 3 b[0] * (1 / 3) b[0] b 0 1 / 3 1 3 a[1] * (2 / 3) + b[1] * (1 / 3) a[1] * (2 / 3) a[1] a 1 2 / 3 2 3 b[1] * (1 / 3) b[1] b 1 1 / 3 1 3 t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3)) t (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3)) a[0] * (1 / 3) + b[0] * (2 / 3) a[0] * (1 / 3) a[0] a 0 1 / 3 1 3 b[0] * (2 / 3) b[0] b 0 2 / 3 2 3 a[1] * (1 / 3) + b[1] * (2 / 3) a[1] * (1 / 3) a[1] a 1 1 / 3 1 3 b[1] * (2 / 3) b[1] b 1 2 / 3 2 3 return s, t return s, t s t a a b b def rotate60(s, t):
    th = math.pi / 3
    u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1])
    u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1])
    return (u0, u1) rotate60 th = math.pi / 3 th math.pi / 3 math.pi math pi 3 u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1]) u0 s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1]) s[0] + math.cos(th) * (t[0] - s[0]) s[0] s 0 math.cos(th) * (t[0] - s[0]) math.cos(th) math.cos math cos th t[0] - s[0] t[0] t 0 s[0] s 0 math.sin(th) * (t[1] - s[1]) math.sin(th) math.sin math sin th t[1] - s[1] t[1] t 1 s[1] s 1 u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1]) u1 s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1]) s[1] + math.sin(th) * (t[0] - s[0]) s[1] s 1 math.sin(th) * (t[0] - s[0]) math.sin(th) math.sin math sin th t[0] - s[0] t[0] t 0 s[0] s 0 math.cos(th) * (t[1] - s[1]) math.cos(th) math.cos math cos th t[1] - s[1] t[1] t 1 s[1] s 1 return (u0, u1) (u0, u1) u0 u1 s s t t lst = [(0, 0), (100, 0)] lst [(0, 0), (100, 0)] (0, 0) 0 0 (100, 0) 100 0 n = int(input()) n int(input()) int input() input for i in range(n):
    L = len(lst)
    new_lst = []
    for l in range(L - 1):
        left = lst[l]
        right = lst[l + 1]
        new_lst.append(left)
        s, t = split3(left, right)
        u = rotate60(s, t)
        new_lst.append(s)
        new_lst.append(u)
        new_lst.append(t)
    new_lst.append(right)
    lst = new_lst i range(n) range n L = len(lst) L len(lst) len lst new_lst = [] new_lst [] for l in range(L - 1):
        left = lst[l]
        right = lst[l + 1]
        new_lst.append(left)
        s, t = split3(left, right)
        u = rotate60(s, t)
        new_lst.append(s)
        new_lst.append(u)
        new_lst.append(t)
     l range(L - 1) range L - 1 L 1 left = lst[l] left lst[l] lst l right = lst[l + 1] right lst[l + 1] lst l + 1 l 1 new_lst.append(left) new_lst.append new_lst append left s, t = split3(left, right) s split3(left, right) split3 left right t u = rotate60(s, t) u rotate60(s, t) rotate60 s t new_lst.append(s) new_lst.append new_lst append s new_lst.append(u) new_lst.append new_lst append u new_lst.append(t) new_lst.append new_lst append t new_lst.append(right) new_lst.append new_lst append right lst = new_lst lst new_lst for p in lst:
    print(*p) p lst print(*p) print *p p lst = [(0, 0), (100, 0)] [(0, 0), (100, 0)] lst new_lst = [] [] new_lst t = split3(left, right) split3(left, right) t s, t = split3(left, right) split3(left, right) s lst = new_lst new_lst lst def rotate60(s, t):
    th = math.pi / 3
    u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1])
    u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1])
    return (u0, u1) def rotate60(s, t):
    th = math.pi / 3
    u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1])
    u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1])
    return (u0, u1) rotate60 n = int(input()) int(input()) n left = lst[l] lst[l] left right = lst[l + 1] lst[l + 1] right u = rotate60(s, t) rotate60(s, t) u L = len(lst) len(lst) L def split3(a, b):
    s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3))
    t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3))
    return s, t def split3(a, b):
    s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3))
    t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3))
    return s, t split3
import math


def split3(a, b):
    s = (a[0] * (2 / 3) + b[0] * (1 / 3), a[1] * (2 / 3) + b[1] * (1 / 3))
    t = (a[0] * (1 / 3) + b[0] * (2 / 3), a[1] * (1 / 3) + b[1] * (2 / 3))
    return s, t


def rotate60(s, t):
    th = math.pi / 3
    u0 = s[0] + math.cos(th) * (t[0] - s[0]) - math.sin(th) * (t[1] - s[1])
    u1 = s[1] + math.sin(th) * (t[0] - s[0]) + math.cos(th) * (t[1] - s[1])
    return (u0, u1)


lst = [(0, 0), (100, 0)]
n = int(input())

for i in range(n):
    L = len(lst)
    new_lst = []
    for l in range(L - 1):
        left = lst[l]
        right = lst[l + 1]
        new_lst.append(left)
        s, t = split3(left, right)
        u = rotate60(s, t)
        new_lst.append(s)
        new_lst.append(u)
        new_lst.append(t)
    new_lst.append(right)
    lst = new_lst
for p in lst:
    print(*p)

