import math
def stdinput():
    from sys import stdin
    return stdin.readline().strip()

def main():
    n = int(stdinput())
    nodes = [[0., 0.], [100., 0.]]

    for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

    for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node))

def koch(start, end):
    nodes = []

    dx = (end[0] - start[0]) / 3
    dy = (end[1] - start[1]) / 3
    
    s = [start[0] + dx, start[1] + dy]
    t = [start[0] + 2 * dx, start[1] + 2 * dy]

    nodes.append(s)
    nodes.append(determine_koch(s, t))
    nodes.append(t)
    
    return nodes

def determine_koch(s, t):
    dx = (t[0] - s[0]) * math.sqrt(3) / 2
    dy = (t[1] - s[1]) * math.sqrt(3) / 2

    u0 = [s[0] - dy, s[1] + dx]
    u1 = [t[0] - dy, t[1] + dx]

    return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ]

if __name__ == '__main__':
    main()
    # import cProfile
    # cProfile.run('main()') import math math def stdinput():
    from sys import stdin
    return stdin.readline().strip() stdinput from sys import stdin return stdin.readline().strip() stdin.readline().strip() stdin.readline().strip stdin.readline() stdin.readline stdin readline strip def main():
    n = int(stdinput())
    nodes = [[0., 0.], [100., 0.]]

    for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

    for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node)) main n = int(stdinput()) n int(stdinput()) int stdinput() stdinput nodes = [[0., 0.], [100., 0.]] nodes [[0., 0.], [100., 0.]] [0., 0.] 0. 0. [100., 0.] 100. 0. for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

     _ range(n) range n next_nodes = [] next_nodes [] for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
         s_node e_node zip(nodes[:], nodes[1:]) zip nodes[:] nodes : nodes[1:] nodes 1: 1 next_nodes.append(s_node) next_nodes.append next_nodes append s_node next_nodes += koch(s_node, e_node) next_nodes koch(s_node, e_node) koch s_node e_node next_nodes.append(nodes[-1]) next_nodes.append next_nodes append nodes[-1] nodes -1 nodes = next_nodes nodes next_nodes for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node)) node nodes print(*map(lambda a: f'{round(a,8):.8f}', node)) print *map(lambda a: f'{round(a,8):.8f}', node) map(lambda a: f'{round(a,8):.8f}', node) map lambda a: f'{round(a,8):.8f}' f'{round(a,8):.8f}' a node def koch(start, end):
    nodes = []

    dx = (end[0] - start[0]) / 3
    dy = (end[1] - start[1]) / 3
    
    s = [start[0] + dx, start[1] + dy]
    t = [start[0] + 2 * dx, start[1] + 2 * dy]

    nodes.append(s)
    nodes.append(determine_koch(s, t))
    nodes.append(t)
    
    return nodes koch nodes = [] nodes [] dx = (end[0] - start[0]) / 3 dx (end[0] - start[0]) / 3 end[0] - start[0] end[0] end 0 start[0] start 0 3 dy = (end[1] - start[1]) / 3 dy (end[1] - start[1]) / 3 end[1] - start[1] end[1] end 1 start[1] start 1 3 s = [start[0] + dx, start[1] + dy] s [start[0] + dx, start[1] + dy] start[0] + dx start[0] start 0 dx start[1] + dy start[1] start 1 dy t = [start[0] + 2 * dx, start[1] + 2 * dy] t [start[0] + 2 * dx, start[1] + 2 * dy] start[0] + 2 * dx start[0] start 0 2 * dx 2 dx start[1] + 2 * dy start[1] start 1 2 * dy 2 dy nodes.append(s) nodes.append nodes append s nodes.append(determine_koch(s, t)) nodes.append nodes append determine_koch(s, t) determine_koch s t nodes.append(t) nodes.append nodes append t return nodes nodes start start end end def determine_koch(s, t):
    dx = (t[0] - s[0]) * math.sqrt(3) / 2
    dy = (t[1] - s[1]) * math.sqrt(3) / 2

    u0 = [s[0] - dy, s[1] + dx]
    u1 = [t[0] - dy, t[1] + dx]

    return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ] determine_koch dx = (t[0] - s[0]) * math.sqrt(3) / 2 dx (t[0] - s[0]) * math.sqrt(3) / 2 (t[0] - s[0]) * math.sqrt(3) t[0] - s[0] t[0] t 0 s[0] s 0 math.sqrt(3) math.sqrt math sqrt 3 2 dy = (t[1] - s[1]) * math.sqrt(3) / 2 dy (t[1] - s[1]) * math.sqrt(3) / 2 (t[1] - s[1]) * math.sqrt(3) t[1] - s[1] t[1] t 1 s[1] s 1 math.sqrt(3) math.sqrt math sqrt 3 2 u0 = [s[0] - dy, s[1] + dx] u0 [s[0] - dy, s[1] + dx] s[0] - dy s[0] s 0 dy s[1] + dx s[1] s 1 dx u1 = [t[0] - dy, t[1] + dx] u1 [t[0] - dy, t[1] + dx] t[0] - dy t[0] t 0 dy t[1] + dx t[1] t 1 dx return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ] [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ] (u0[0] + u1[0]) / 2 u0[0] + u1[0] u0[0] u0 0 u1[0] u1 0 2 (u0[1] + u1[1]) / 2 u0[1] + u1[1] u0[1] u0 1 u1[1] u1 1 2 s s t t if __name__ == '__main__':
    main()
    # import cProfile
    # cProfile.run('main()') __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(stdinput())
    nodes = [[0., 0.], [100., 0.]]

    for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

    for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node)) def main():
    n = int(stdinput())
    nodes = [[0., 0.], [100., 0.]]

    for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

    for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node)) main def koch(start, end):
    nodes = []

    dx = (end[0] - start[0]) / 3
    dy = (end[1] - start[1]) / 3
    
    s = [start[0] + dx, start[1] + dy]
    t = [start[0] + 2 * dx, start[1] + 2 * dy]

    nodes.append(s)
    nodes.append(determine_koch(s, t))
    nodes.append(t)
    
    return nodes def koch(start, end):
    nodes = []

    dx = (end[0] - start[0]) / 3
    dy = (end[1] - start[1]) / 3
    
    s = [start[0] + dx, start[1] + dy]
    t = [start[0] + 2 * dx, start[1] + 2 * dy]

    nodes.append(s)
    nodes.append(determine_koch(s, t))
    nodes.append(t)
    
    return nodes koch def determine_koch(s, t):
    dx = (t[0] - s[0]) * math.sqrt(3) / 2
    dy = (t[1] - s[1]) * math.sqrt(3) / 2

    u0 = [s[0] - dy, s[1] + dx]
    u1 = [t[0] - dy, t[1] + dx]

    return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ] def determine_koch(s, t):
    dx = (t[0] - s[0]) * math.sqrt(3) / 2
    dy = (t[1] - s[1]) * math.sqrt(3) / 2

    u0 = [s[0] - dy, s[1] + dx]
    u1 = [t[0] - dy, t[1] + dx]

    return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ] determine_koch def stdinput():
    from sys import stdin
    return stdin.readline().strip() def stdinput():
    from sys import stdin
    return stdin.readline().strip() stdinput
import math
def stdinput():
    from sys import stdin
    return stdin.readline().strip()

def main():
    n = int(stdinput())
    nodes = [[0., 0.], [100., 0.]]

    for _ in range(n):
        next_nodes = []
        for s_node, e_node in zip(nodes[:], nodes[1:]):
            next_nodes.append(s_node)
            next_nodes += koch(s_node, e_node)
        next_nodes.append(nodes[-1])
        nodes = next_nodes

    for node in nodes:
        print(*map(lambda a: f'{round(a,8):.8f}', node))

def koch(start, end):
    nodes = []

    dx = (end[0] - start[0]) / 3
    dy = (end[1] - start[1]) / 3
    
    s = [start[0] + dx, start[1] + dy]
    t = [start[0] + 2 * dx, start[1] + 2 * dy]

    nodes.append(s)
    nodes.append(determine_koch(s, t))
    nodes.append(t)
    
    return nodes

def determine_koch(s, t):
    dx = (t[0] - s[0]) * math.sqrt(3) / 2
    dy = (t[1] - s[1]) * math.sqrt(3) / 2

    u0 = [s[0] - dy, s[1] + dx]
    u1 = [t[0] - dy, t[1] + dx]

    return [
        (u0[0] + u1[0]) / 2,
        (u0[1] + u1[1]) / 2
    ]

if __name__ == '__main__':
    main()
    # import cProfile
    # cProfile.run('main()')
