#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
import math

DEG60 = math.pi/3

def repl_edge(n, edges):
    # print('n=',n, 'edges=', len(edges))
    if n == 0:
        return edges
    new_list = list()
    for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

    new_list = repl_edge(n-1, new_list)
    return new_list


n = int(sys.stdin.readline())
p1 = (0.0, 0.0)
p2 = (100.0, 0.0)
edges = [(p1, p2, 0.0)]

edges = repl_edge(n, edges)
for edge in edges:
    print(round(edge[0][0],6), round(edge[0][1],6))
print(round(edges[-1][1][0],6), round(edges[-1][1][1],6))
 import sys sys import math math DEG60 = math.pi/3 DEG60 math.pi/3 math.pi math pi 3 def repl_edge(n, edges):
    # print('n=',n, 'edges=', len(edges))
    if n == 0:
        return edges
    new_list = list()
    for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

    new_list = repl_edge(n-1, new_list)
    return new_list repl_edge if n == 0:
        return edges
     n == 0 n 0 return edges edges new_list = list() new_list list() list for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

     edge edges p1 = edge[0] p1 edge[0] edge 0 p2 = edge[1] p2 edge[1] edge 1 p_angle = edge[2] p_angle edge[2] edge 2 s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3) s ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3) (p1[0]*2+p2[0])/3 p1[0]*2+p2[0] p1[0]*2 p1[0] p1 0 2 p2[0] p2 0 3 (p1[1]*2+p2[1])/3 p1[1]*2+p2[1] p1[1]*2 p1[1] p1 1 2 p2[1] p2 1 3 t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3) t ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3) (p1[0]+p2[0]*2)/3 p1[0]+p2[0]*2 p1[0] p1 0 p2[0]*2 p2[0] p2 0 2 3 (p1[1]+p2[1]*2)/3 p1[1]+p2[1]*2 p1[1] p1 1 p2[1]*2 p2[1] p2 1 2 3 r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5 r abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5 abs((t[0]-s[0])**2 + (t[1]-s[1])**2) abs (t[0]-s[0])**2 + (t[1]-s[1])**2 (t[0]-s[0])**2 t[0]-s[0] t[0] t 0 s[0] s 0 2 (t[1]-s[1])**2 t[1]-s[1] t[1] t 1 s[1] s 1 2 0.5 angle = p_angle + DEG60 angle p_angle + DEG60 p_angle DEG60 u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r) u (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r) s[0] + math.cos(angle)*r s[0] s 0 math.cos(angle)*r math.cos(angle) math.cos math cos angle r s[1] + math.sin(angle)*r s[1] s 1 math.sin(angle)*r math.sin(angle) math.sin math sin angle r new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)] new_list [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)] (p1, s, p_angle) p1 s p_angle (s, u, p_angle+DEG60) s u p_angle+DEG60 p_angle DEG60 (u, t, p_angle-DEG60) u t p_angle-DEG60 p_angle DEG60 (t, p2, p_angle) t p2 p_angle new_list = repl_edge(n-1, new_list) new_list repl_edge(n-1, new_list) repl_edge n-1 n 1 new_list return new_list new_list n n edges edges n = int(sys.stdin.readline()) n int(sys.stdin.readline()) int sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline p1 = (0.0, 0.0) p1 (0.0, 0.0) 0.0 0.0 p2 = (100.0, 0.0) p2 (100.0, 0.0) 100.0 0.0 edges = [(p1, p2, 0.0)] edges [(p1, p2, 0.0)] (p1, p2, 0.0) p1 p2 0.0 edges = repl_edge(n, edges) edges repl_edge(n, edges) repl_edge n edges for edge in edges:
    print(round(edge[0][0],6), round(edge[0][1],6)) edge edges print(round(edge[0][0],6), round(edge[0][1],6)) print round(edge[0][0],6) round edge[0][0] [0] edge 0 0 6 round(edge[0][1],6) round edge[0][1] [0] edge 0 1 6 print(round(edges[-1][1][0],6), round(edges[-1][1][1],6)) print round(edges[-1][1][0],6) round edges[-1][1][0] [1] [-1] edges -1 1 0 6 round(edges[-1][1][1],6) round edges[-1][1][1] [1] [-1] edges -1 1 1 6 p2 = (100.0, 0.0) (100.0, 0.0) p2 DEG60 = math.pi/3 math.pi/3 DEG60 edges = repl_edge(n, edges) repl_edge(n, edges) edges def repl_edge(n, edges):
    # print('n=',n, 'edges=', len(edges))
    if n == 0:
        return edges
    new_list = list()
    for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

    new_list = repl_edge(n-1, new_list)
    return new_list def repl_edge(n, edges):
    # print('n=',n, 'edges=', len(edges))
    if n == 0:
        return edges
    new_list = list()
    for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

    new_list = repl_edge(n-1, new_list)
    return new_list repl_edge n = int(sys.stdin.readline()) int(sys.stdin.readline()) n p1 = (0.0, 0.0) (0.0, 0.0) p1 edges = [(p1, p2, 0.0)] [(p1, p2, 0.0)] edges
#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys
import math

DEG60 = math.pi/3

def repl_edge(n, edges):
    # print('n=',n, 'edges=', len(edges))
    if n == 0:
        return edges
    new_list = list()
    for edge in edges:  # single tupple
        p1 = edge[0]
        p2 = edge[1]
        p_angle = edge[2]
        s = ((p1[0]*2+p2[0])/3, (p1[1]*2+p2[1])/3)
        t = ((p1[0]+p2[0]*2)/3, (p1[1]+p2[1]*2)/3)
        r = abs((t[0]-s[0])**2 + (t[1]-s[1])**2) ** 0.5
        angle = p_angle + DEG60
        u = (s[0] + math.cos(angle)*r, s[1] + math.sin(angle)*r)
        # print('r=', r, 'u=', u, 'angle=', angle)
        new_list += [(p1, s, p_angle), (s, u, p_angle+DEG60), \
                    (u, t, p_angle-DEG60), (t, p2, p_angle)]

    new_list = repl_edge(n-1, new_list)
    return new_list


n = int(sys.stdin.readline())
p1 = (0.0, 0.0)
p2 = (100.0, 0.0)
edges = [(p1, p2, 0.0)]

edges = repl_edge(n, edges)
for edge in edges:
    print(round(edge[0][0],6), round(edge[0][1],6))
print(round(edges[-1][1][0],6), round(edges[-1][1][1],6))

