import math

def get_input():
    depth = int(input())
    return depth


def koch_curve(p1, p2):
    dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
    
    point3=[p1[0]+dp[0], p1[1] + dp[1]]
    point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2]

    rad60 = math.pi/3
    dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)]
    

    point4=[point3[0]+dp2[0], point3[1] + dp2[1]]

    return ([point3, point4, point5])



def rec_koch_curve(pl, depth, target):
    if (target <= depth) :
        return
    
    for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

    rec_koch_curve(pl, depth+1, target)

def print_curve(pl):
    for p in pl:
        print(p[0],p[1],sep=" ")

pl = [[0,0],[100,0]]
rec_koch_curve(pl, 0, get_input())
print_curve(pl) import math math def get_input():
    depth = int(input())
    return depth get_input depth = int(input()) depth int(input()) int input() input return depth depth def koch_curve(p1, p2):
    dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
    
    point3=[p1[0]+dp[0], p1[1] + dp[1]]
    point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2]

    rad60 = math.pi/3
    dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)]
    

    point4=[point3[0]+dp2[0], point3[1] + dp2[1]]

    return ([point3, point4, point5]) koch_curve dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3] dp [(p2[0]-p1[0])/3, (p2[1]-p1[1])/3] (p2[0]-p1[0])/3 p2[0]-p1[0] p2[0] p2 0 p1[0] p1 0 3 (p2[1]-p1[1])/3 p2[1]-p1[1] p2[1] p2 1 p1[1] p1 1 3 point3=[p1[0]+dp[0], p1[1] + dp[1]] point3 [p1[0]+dp[0], p1[1] + dp[1]] p1[0]+dp[0] p1[0] p1 0 dp[0] dp 0 p1[1] + dp[1] p1[1] p1 1 dp[1] dp 1 point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2] point5 [p1[0]+dp[0]*2, p1[1] + dp[1]*2] p1[0]+dp[0]*2 p1[0] p1 0 dp[0]*2 dp[0] dp 0 2 p1[1] + dp[1]*2 p1[1] p1 1 dp[1]*2 dp[1] dp 1 2 rad60 = math.pi/3 rad60 math.pi/3 math.pi math pi 3 dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)] dp2 [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)] dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60) dp[0]*math.cos(rad60) dp[0] dp 0 math.cos(rad60) math.cos math cos rad60 dp[1]*math.sin(rad60) dp[1] dp 1 math.sin(rad60) math.sin math sin rad60 dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60) dp[0]*math.sin(rad60) dp[0] dp 0 math.sin(rad60) math.sin math sin rad60 dp[1]*math.cos(rad60) dp[1] dp 1 math.cos(rad60) math.cos math cos rad60 point4=[point3[0]+dp2[0], point3[1] + dp2[1]] point4 [point3[0]+dp2[0], point3[1] + dp2[1]] point3[0]+dp2[0] point3[0] point3 0 dp2[0] dp2 0 point3[1] + dp2[1] point3[1] point3 1 dp2[1] dp2 1 return ([point3, point4, point5]) [point3, point4, point5] point3 point4 point5 p1 p1 p2 p2 def rec_koch_curve(pl, depth, target):
    if (target <= depth) :
        return
    
    for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

    rec_koch_curve(pl, depth+1, target) rec_koch_curve if (target <= depth) :
        return
    
     target <= depth target depth return for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

     i range(len(pl)-1)[::-1] (len(pl)-1) range len(pl)-1 len(pl) len pl 1 ::-1 -1 tplist = koch_curve(pl[i] , pl[i+1]) tplist koch_curve(pl[i] , pl[i+1]) koch_curve pl[i] pl i pl[i+1] pl i+1 i 1 for p in tplist[::-1]:
            pl.insert(i+1, p)

     p tplist[::-1] tplist ::-1 -1 pl.insert(i+1, p) pl.insert pl insert i+1 i 1 p rec_koch_curve(pl, depth+1, target) rec_koch_curve pl depth+1 depth 1 target pl pl depth depth target target def print_curve(pl):
    for p in pl:
        print(p[0],p[1],sep=" ") print_curve for p in pl:
        print(p[0],p[1],sep=" ") p pl print(p[0],p[1],sep=" ") print p[0] p 0 p[1] p 1 sep=" " sep " " pl pl pl = [[0,0],[100,0]] pl [[0,0],[100,0]] [0,0] 0 0 [100,0] 100 0 rec_koch_curve(pl, 0, get_input()) rec_koch_curve pl 0 get_input() get_input print_curve(pl) print_curve pl def get_input():
    depth = int(input())
    return depth def get_input():
    depth = int(input())
    return depth get_input pl = [[0,0],[100,0]] [[0,0],[100,0]] pl def print_curve(pl):
    for p in pl:
        print(p[0],p[1],sep=" ") def print_curve(pl):
    for p in pl:
        print(p[0],p[1],sep=" ") print_curve def koch_curve(p1, p2):
    dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
    
    point3=[p1[0]+dp[0], p1[1] + dp[1]]
    point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2]

    rad60 = math.pi/3
    dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)]
    

    point4=[point3[0]+dp2[0], point3[1] + dp2[1]]

    return ([point3, point4, point5]) def koch_curve(p1, p2):
    dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
    
    point3=[p1[0]+dp[0], p1[1] + dp[1]]
    point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2]

    rad60 = math.pi/3
    dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)]
    

    point4=[point3[0]+dp2[0], point3[1] + dp2[1]]

    return ([point3, point4, point5]) koch_curve def rec_koch_curve(pl, depth, target):
    if (target <= depth) :
        return
    
    for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

    rec_koch_curve(pl, depth+1, target) def rec_koch_curve(pl, depth, target):
    if (target <= depth) :
        return
    
    for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

    rec_koch_curve(pl, depth+1, target) rec_koch_curve
import math

def get_input():
    depth = int(input())
    return depth


def koch_curve(p1, p2):
    dp=[(p2[0]-p1[0])/3, (p2[1]-p1[1])/3]
    
    point3=[p1[0]+dp[0], p1[1] + dp[1]]
    point5=[p1[0]+dp[0]*2, p1[1] + dp[1]*2]

    rad60 = math.pi/3
    dp2 = [dp[0]*math.cos(rad60)-dp[1]*math.sin(rad60), 
           dp[0]*math.sin(rad60)+dp[1]*math.cos(rad60)]
    

    point4=[point3[0]+dp2[0], point3[1] + dp2[1]]

    return ([point3, point4, point5])



def rec_koch_curve(pl, depth, target):
    if (target <= depth) :
        return
    
    for i in range(len(pl)-1)[::-1]:
        tplist = koch_curve(pl[i] , pl[i+1])
        for p in tplist[::-1]:
            pl.insert(i+1, p)

    rec_koch_curve(pl, depth+1, target)

def print_curve(pl):
    for p in pl:
        print(p[0],p[1],sep=" ")

pl = [[0,0],[100,0]]
rec_koch_curve(pl, 0, get_input())
print_curve(pl)
