import math

n = int(input())

def foo(p1, p2):
    s_x = p1[0] + (p2[0] - p1[0]) / 3.0
    s_y = p1[1] + (p2[1] - p1[1]) / 3.0
    t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0
    t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0
    u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x
    u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y

    return [[s_x, s_y], [u_x, u_y], [t_x, t_y]]

def bar(arr):
    result = []
    for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
    result.append(arr[-1])
    return result

result = [[0, 0], [100.0, 0]]

for i in range(n):
    result = bar(result)

for ret in result:
    print("{} {}".format(ret[0], ret[1]))
 import math math n = int(input()) n int(input()) int input() input def foo(p1, p2):
    s_x = p1[0] + (p2[0] - p1[0]) / 3.0
    s_y = p1[1] + (p2[1] - p1[1]) / 3.0
    t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0
    t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0
    u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x
    u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y

    return [[s_x, s_y], [u_x, u_y], [t_x, t_y]] foo s_x = p1[0] + (p2[0] - p1[0]) / 3.0 s_x p1[0] + (p2[0] - p1[0]) / 3.0 p1[0] p1 0 (p2[0] - p1[0]) / 3.0 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 3.0 s_y = p1[1] + (p2[1] - p1[1]) / 3.0 s_y p1[1] + (p2[1] - p1[1]) / 3.0 p1[1] p1 1 (p2[1] - p1[1]) / 3.0 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 3.0 t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0 t_x p1[0] + (2 * (p2[0] - p1[0])) / 3.0 p1[0] p1 0 (2 * (p2[0] - p1[0])) / 3.0 2 * (p2[0] - p1[0]) 2 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 3.0 t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0 t_y p1[1] +  (2 * (p2[1] - p1[1])) / 3.0 p1[1] p1 1 (2 * (p2[1] - p1[1])) / 3.0 2 * (p2[1] - p1[1]) 2 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 3.0 u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x u_x math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) math.cos(math.radians(60)) * (t_x - s_x) math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 t_x - s_x t_x s_x math.sin(math.radians(60)) * (t_y - s_y) math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 t_y - s_y t_y s_y s_x u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y u_y math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) math.sin(math.radians(60)) * (t_x - s_x) math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 t_x - s_x t_x s_x math.cos(math.radians(60)) * (t_y - s_y) math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 t_y - s_y t_y s_y s_y return [[s_x, s_y], [u_x, u_y], [t_x, t_y]] [[s_x, s_y], [u_x, u_y], [t_x, t_y]] [s_x, s_y] s_x s_y [u_x, u_y] u_x u_y [t_x, t_y] t_x t_y p1 p1 p2 p2 def bar(arr):
    result = []
    for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
    result.append(arr[-1])
    return result bar result = [] result [] for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
     i range(len(arr) - 1) range len(arr) - 1 len(arr) len arr 1 result.append(arr[i]) result.append result append arr[i] arr i result.extend(foo(arr[i], arr[i + 1])) result.extend result extend foo(arr[i], arr[i + 1]) foo arr[i] arr i arr[i + 1] arr i + 1 i 1 result.append(arr[-1]) result.append result append arr[-1] arr -1 return result result arr arr result = [[0, 0], [100.0, 0]] result [[0, 0], [100.0, 0]] [0, 0] 0 0 [100.0, 0] 100.0 0 for i in range(n):
    result = bar(result) i range(n) range n result = bar(result) result bar(result) bar result for ret in result:
    print("{} {}".format(ret[0], ret[1])) ret result print("{} {}".format(ret[0], ret[1])) print "{} {}".format(ret[0], ret[1]) "{} {}".format "{} {}" format ret[0] ret 0 ret[1] ret 1 result = [[0, 0], [100.0, 0]] [[0, 0], [100.0, 0]] result result = bar(result) bar(result) result n = int(input()) int(input()) n def foo(p1, p2):
    s_x = p1[0] + (p2[0] - p1[0]) / 3.0
    s_y = p1[1] + (p2[1] - p1[1]) / 3.0
    t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0
    t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0
    u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x
    u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y

    return [[s_x, s_y], [u_x, u_y], [t_x, t_y]] def foo(p1, p2):
    s_x = p1[0] + (p2[0] - p1[0]) / 3.0
    s_y = p1[1] + (p2[1] - p1[1]) / 3.0
    t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0
    t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0
    u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x
    u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y

    return [[s_x, s_y], [u_x, u_y], [t_x, t_y]] foo def bar(arr):
    result = []
    for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
    result.append(arr[-1])
    return result def bar(arr):
    result = []
    for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
    result.append(arr[-1])
    return result bar
import math

n = int(input())

def foo(p1, p2):
    s_x = p1[0] + (p2[0] - p1[0]) / 3.0
    s_y = p1[1] + (p2[1] - p1[1]) / 3.0
    t_x = p1[0] + (2 * (p2[0] - p1[0])) / 3.0
    t_y = p1[1] +  (2 * (p2[1] - p1[1])) / 3.0
    u_x = math.cos(math.radians(60)) * (t_x - s_x) - math.sin(math.radians(60)) * (t_y - s_y) + s_x
    u_y = math.sin(math.radians(60)) * (t_x - s_x) + math.cos(math.radians(60)) * (t_y - s_y) + s_y

    return [[s_x, s_y], [u_x, u_y], [t_x, t_y]]

def bar(arr):
    result = []
    for i in range(len(arr) - 1):
        result.append(arr[i])
        result.extend(foo(arr[i], arr[i + 1]))
    result.append(arr[-1])
    return result

result = [[0, 0], [100.0, 0]]

for i in range(n):
    result = bar(result)

for ret in result:
    print("{} {}".format(ret[0], ret[1]))

