import math
cos60 = math.cos(math.pi*60/180)
sin60 = math.sin(math.pi*60/180)
#add_triangle
# input: start(x, y) end(x, y)
def add_triangle(start, end):
    x1 = (2*start[0] + end[0]) / 3
    x3 = (start[0] + 2*end[0]) / 3
    y1 = (2*start[1] + end[1]) / 3
    y3 = (start[1] + 2*end[1]) / 3
    x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60
    y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60
    return [(x1,y1), (x2,y2), (x3,y3)]

#koch_recursion
#input list [(x1,y1),(x2,y2),(x3,y3)...]
def koch_recursion(list1):
    output = []
    for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
    output.append(list1[len(list1)-1])
    return output

#Koch  call koch_recursion(0, 100)
def Koch(start, end, n):
    output = [start, end]
    for i in range(n):
        output = koch_recursion(output)
    for x, y in output:
        print("{:.8f} {:.8f}".format(x, y))

n = int(input())
Koch((0,0), (100,0), n) import math math cos60 = math.cos(math.pi*60/180) cos60 math.cos(math.pi*60/180) math.cos math cos math.pi*60/180 math.pi*60 math.pi math pi 60 180 sin60 = math.sin(math.pi*60/180) sin60 math.sin(math.pi*60/180) math.sin math sin math.pi*60/180 math.pi*60 math.pi math pi 60 180 def add_triangle(start, end):
    x1 = (2*start[0] + end[0]) / 3
    x3 = (start[0] + 2*end[0]) / 3
    y1 = (2*start[1] + end[1]) / 3
    y3 = (start[1] + 2*end[1]) / 3
    x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60
    y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60
    return [(x1,y1), (x2,y2), (x3,y3)]

#koch_recursion
#input list [(x1,y1),(x2,y2),(x3,y3)...] add_triangle x1 = (2*start[0] + end[0]) / 3 x1 (2*start[0] + end[0]) / 3 2*start[0] + end[0] 2*start[0] 2 start[0] start 0 end[0] end 0 3 x3 = (start[0] + 2*end[0]) / 3 x3 (start[0] + 2*end[0]) / 3 start[0] + 2*end[0] start[0] start 0 2*end[0] 2 end[0] end 0 3 y1 = (2*start[1] + end[1]) / 3 y1 (2*start[1] + end[1]) / 3 2*start[1] + end[1] 2*start[1] 2 start[1] start 1 end[1] end 1 3 y3 = (start[1] + 2*end[1]) / 3 y3 (start[1] + 2*end[1]) / 3 start[1] + 2*end[1] start[1] start 1 2*end[1] 2 end[1] end 1 3 x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60 x2 x1 + (x3-x1)*cos60 - (y3-y1)*sin60 x1 + (x3-x1)*cos60 x1 (x3-x1)*cos60 x3-x1 x3 x1 cos60 (y3-y1)*sin60 y3-y1 y3 y1 sin60 y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60 y2 y1 + (x3-x1)*sin60 + (y3-y1)*cos60 y1 + (x3-x1)*sin60 y1 (x3-x1)*sin60 x3-x1 x3 x1 sin60 (y3-y1)*cos60 y3-y1 y3 y1 cos60 return [(x1,y1), (x2,y2), (x3,y3)] [(x1,y1), (x2,y2), (x3,y3)] (x1,y1) x1 y1 (x2,y2) x2 y2 (x3,y3) x3 y3 start start end end def koch_recursion(list1):
    output = []
    for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
    output.append(list1[len(list1)-1])
    return output

#Koch  call koch_recursion(0, 100) koch_recursion output = [] output [] for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
     i range(len(list1)-1) range len(list1)-1 len(list1) len list1 1 output.append(list1[i]) output.append output append list1[i] list1 i output += add_triangle(list1[i], list1[i+1]) output add_triangle(list1[i], list1[i+1]) add_triangle list1[i] list1 i list1[i+1] list1 i+1 i 1 output.append(list1[len(list1)-1]) output.append output append list1[len(list1)-1] list1 len(list1)-1 len(list1) len list1 1 return output output list1 list1 def Koch(start, end, n):
    output = [start, end]
    for i in range(n):
        output = koch_recursion(output)
    for x, y in output:
        print("{:.8f} {:.8f}".format(x, y)) Koch output = [start, end] output [start, end] start end for i in range(n):
        output = koch_recursion(output)
     i range(n) range n output = koch_recursion(output) output koch_recursion(output) koch_recursion output for x, y in output:
        print("{:.8f} {:.8f}".format(x, y)) x y output print("{:.8f} {:.8f}".format(x, y)) print "{:.8f} {:.8f}".format(x, y) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format x y start start end end n n n = int(input()) n int(input()) int input() input Koch((0,0), (100,0), n) Koch (0,0) 0 0 (100,0) 100 0 n def Koch(start, end, n):
    output = [start, end]
    for i in range(n):
        output = koch_recursion(output)
    for x, y in output:
        print("{:.8f} {:.8f}".format(x, y)) def Koch(start, end, n):
    output = [start, end]
    for i in range(n):
        output = koch_recursion(output)
    for x, y in output:
        print("{:.8f} {:.8f}".format(x, y)) Koch cos60 = math.cos(math.pi*60/180) math.cos(math.pi*60/180) cos60 def add_triangle(start, end):
    x1 = (2*start[0] + end[0]) / 3
    x3 = (start[0] + 2*end[0]) / 3
    y1 = (2*start[1] + end[1]) / 3
    y3 = (start[1] + 2*end[1]) / 3
    x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60
    y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60
    return [(x1,y1), (x2,y2), (x3,y3)]

#koch_recursion
#input list [(x1,y1),(x2,y2),(x3,y3)...] def add_triangle(start, end):
    x1 = (2*start[0] + end[0]) / 3
    x3 = (start[0] + 2*end[0]) / 3
    y1 = (2*start[1] + end[1]) / 3
    y3 = (start[1] + 2*end[1]) / 3
    x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60
    y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60
    return [(x1,y1), (x2,y2), (x3,y3)]

#koch_recursion
#input list [(x1,y1),(x2,y2),(x3,y3)...] add_triangle sin60 = math.sin(math.pi*60/180) math.sin(math.pi*60/180) sin60 def koch_recursion(list1):
    output = []
    for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
    output.append(list1[len(list1)-1])
    return output

#Koch  call koch_recursion(0, 100) def koch_recursion(list1):
    output = []
    for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
    output.append(list1[len(list1)-1])
    return output

#Koch  call koch_recursion(0, 100) koch_recursion n = int(input()) int(input()) n
import math
cos60 = math.cos(math.pi*60/180)
sin60 = math.sin(math.pi*60/180)
#add_triangle
# input: start(x, y) end(x, y)
def add_triangle(start, end):
    x1 = (2*start[0] + end[0]) / 3
    x3 = (start[0] + 2*end[0]) / 3
    y1 = (2*start[1] + end[1]) / 3
    y3 = (start[1] + 2*end[1]) / 3
    x2 = x1 + (x3-x1)*cos60 - (y3-y1)*sin60
    y2 = y1 + (x3-x1)*sin60 + (y3-y1)*cos60
    return [(x1,y1), (x2,y2), (x3,y3)]

#koch_recursion
#input list [(x1,y1),(x2,y2),(x3,y3)...]
def koch_recursion(list1):
    output = []
    for i in range(len(list1)-1):
        output.append(list1[i])
        output += add_triangle(list1[i], list1[i+1])
    output.append(list1[len(list1)-1])
    return output

#Koch  call koch_recursion(0, 100)
def Koch(start, end, n):
    output = [start, end]
    for i in range(n):
        output = koch_recursion(output)
    for x, y in output:
        print("{:.8f} {:.8f}".format(x, y))

n = int(input())
Koch((0,0), (100,0), n)
