import math

def koch(d,p1x,p1y,p2x,p2y):
    if d == 0:
        return 0
    
    sin = math.sin(math.radians(60))
    cos = math.cos(math.radians(60))
    ax = (2 * p1x + 1 * p2x)/3 
    ay = (2 * p1y + 1 * p2y)/3 
    bx = (1 * p1x + 2 * p2x)/3 
    by = (1 * p1y + 2 * p2y)/3
    ux = (bx - ax)* cos - (by - ay)*sin + ax 
    uy = (bx - ax)* sin + (by - ay)*cos + ay

    koch(d-1,p1x,p1y,ax,ay)
    print(ax,ay)
    koch(d-1,ax,ay,ux,uy)
    print(ux,uy)
    koch(d-1,ux,uy,bx,by)
    print(bx,by)
    koch(d-1,bx,by,p2x,p2y)

d = int(input())
print(0,0)
koch(d,0,0,100,0)
print(100,0) import math math def koch(d,p1x,p1y,p2x,p2y):
    if d == 0:
        return 0
    
    sin = math.sin(math.radians(60))
    cos = math.cos(math.radians(60))
    ax = (2 * p1x + 1 * p2x)/3 
    ay = (2 * p1y + 1 * p2y)/3 
    bx = (1 * p1x + 2 * p2x)/3 
    by = (1 * p1y + 2 * p2y)/3
    ux = (bx - ax)* cos - (by - ay)*sin + ax 
    uy = (bx - ax)* sin + (by - ay)*cos + ay

    koch(d-1,p1x,p1y,ax,ay)
    print(ax,ay)
    koch(d-1,ax,ay,ux,uy)
    print(ux,uy)
    koch(d-1,ux,uy,bx,by)
    print(bx,by)
    koch(d-1,bx,by,p2x,p2y) koch if d == 0:
        return 0
    
     d == 0 d 0 return 0 0 sin = math.sin(math.radians(60)) sin math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 cos = math.cos(math.radians(60)) cos math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 ax = (2 * p1x + 1 * p2x)/3 ax (2 * p1x + 1 * p2x)/3 2 * p1x + 1 * p2x 2 * p1x 2 p1x 1 * p2x 1 p2x 3 ay = (2 * p1y + 1 * p2y)/3 ay (2 * p1y + 1 * p2y)/3 2 * p1y + 1 * p2y 2 * p1y 2 p1y 1 * p2y 1 p2y 3 bx = (1 * p1x + 2 * p2x)/3 bx (1 * p1x + 2 * p2x)/3 1 * p1x + 2 * p2x 1 * p1x 1 p1x 2 * p2x 2 p2x 3 by = (1 * p1y + 2 * p2y)/3 by (1 * p1y + 2 * p2y)/3 1 * p1y + 2 * p2y 1 * p1y 1 p1y 2 * p2y 2 p2y 3 ux = (bx - ax)* cos - (by - ay)*sin + ax ux (bx - ax)* cos - (by - ay)*sin + ax (bx - ax)* cos - (by - ay)*sin (bx - ax)* cos bx - ax bx ax cos (by - ay)*sin by - ay by ay sin ax uy = (bx - ax)* sin + (by - ay)*cos + ay uy (bx - ax)* sin + (by - ay)*cos + ay (bx - ax)* sin + (by - ay)*cos (bx - ax)* sin bx - ax bx ax sin (by - ay)*cos by - ay by ay cos ay koch(d-1,p1x,p1y,ax,ay) koch d-1 d 1 p1x p1y ax ay print(ax,ay) print ax ay koch(d-1,ax,ay,ux,uy) koch d-1 d 1 ax ay ux uy print(ux,uy) print ux uy koch(d-1,ux,uy,bx,by) koch d-1 d 1 ux uy bx by print(bx,by) print bx by koch(d-1,bx,by,p2x,p2y) koch d-1 d 1 bx by p2x p2y d d p1x p1x p1y p1y p2x p2x p2y p2y d = int(input()) d int(input()) int input() input print(0,0) print 0 0 koch(d,0,0,100,0) koch d 0 0 100 0 print(100,0) print 100 0 d = int(input()) int(input()) d def koch(d,p1x,p1y,p2x,p2y):
    if d == 0:
        return 0
    
    sin = math.sin(math.radians(60))
    cos = math.cos(math.radians(60))
    ax = (2 * p1x + 1 * p2x)/3 
    ay = (2 * p1y + 1 * p2y)/3 
    bx = (1 * p1x + 2 * p2x)/3 
    by = (1 * p1y + 2 * p2y)/3
    ux = (bx - ax)* cos - (by - ay)*sin + ax 
    uy = (bx - ax)* sin + (by - ay)*cos + ay

    koch(d-1,p1x,p1y,ax,ay)
    print(ax,ay)
    koch(d-1,ax,ay,ux,uy)
    print(ux,uy)
    koch(d-1,ux,uy,bx,by)
    print(bx,by)
    koch(d-1,bx,by,p2x,p2y) def koch(d,p1x,p1y,p2x,p2y):
    if d == 0:
        return 0
    
    sin = math.sin(math.radians(60))
    cos = math.cos(math.radians(60))
    ax = (2 * p1x + 1 * p2x)/3 
    ay = (2 * p1y + 1 * p2y)/3 
    bx = (1 * p1x + 2 * p2x)/3 
    by = (1 * p1y + 2 * p2y)/3
    ux = (bx - ax)* cos - (by - ay)*sin + ax 
    uy = (bx - ax)* sin + (by - ay)*cos + ay

    koch(d-1,p1x,p1y,ax,ay)
    print(ax,ay)
    koch(d-1,ax,ay,ux,uy)
    print(ux,uy)
    koch(d-1,ux,uy,bx,by)
    print(bx,by)
    koch(d-1,bx,by,p2x,p2y) koch
import math

def koch(d,p1x,p1y,p2x,p2y):
    if d == 0:
        return 0
    
    sin = math.sin(math.radians(60))
    cos = math.cos(math.radians(60))
    ax = (2 * p1x + 1 * p2x)/3 
    ay = (2 * p1y + 1 * p2y)/3 
    bx = (1 * p1x + 2 * p2x)/3 
    by = (1 * p1y + 2 * p2y)/3
    ux = (bx - ax)* cos - (by - ay)*sin + ax 
    uy = (bx - ax)* sin + (by - ay)*cos + ay

    koch(d-1,p1x,p1y,ax,ay)
    print(ax,ay)
    koch(d-1,ax,ay,ux,uy)
    print(ux,uy)
    koch(d-1,ux,uy,bx,by)
    print(bx,by)
    koch(d-1,bx,by,p2x,p2y)

d = int(input())
print(0,0)
koch(d,0,0,100,0)
print(100,0)
