import math

def Koch(Px, Py, Qx, Qy, n) :
    if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1)

n = int(input())
print(0, 0.00000000)
Koch(0.00000000, 0.00000000, 100.00000000, 0.00000000, n)
print(100.00000000, 0.00000000)
 import math math def Koch(Px, Py, Qx, Qy, n) :
    if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1) Koch if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1) n == 0 n 0 return Ax = (2 * Px + Qx) / 3 Ax (2 * Px + Qx) / 3 2 * Px + Qx 2 * Px 2 Px Qx 3 Ay = (2 * Py + Qy) / 3 Ay (2 * Py + Qy) / 3 2 * Py + Qy 2 * Py 2 Py Qy 3 Bx = (Px + 2 * Qx) / 3 Bx (Px + 2 * Qx) / 3 Px + 2 * Qx Px 2 * Qx 2 Qx 3 By = (Py + 2 * Qy) / 3 By (Py + 2 * Qy) / 3 Py + 2 * Qy Py 2 * Qy 2 Qy 3 Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) Cx Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) Ax + (Bx - Ax) * math.cos(math.pi/3) Ax (Bx - Ax) * math.cos(math.pi/3) Bx - Ax Bx Ax math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 (By - Ay) * math.sin(math.pi/3) By - Ay By Ay math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3) Cy Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3) Ay + (Bx - Ax) * math.sin(math.pi/3) Ay (Bx - Ax) * math.sin(math.pi/3) Bx - Ax Bx Ax math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 (By - Ay) * math.cos(math.pi/3) By - Ay By Ay math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 Koch(Px, Py, Ax, Ay, n-1) Koch Px Py Ax Ay n-1 n 1 print(Ax, Ay) print Ax Ay Koch(Ax, Ay, Cx, Cy, n-1) Koch Ax Ay Cx Cy n-1 n 1 print(Cx, Cy) print Cx Cy Koch(Cx, Cy, Bx, By, n-1) Koch Cx Cy Bx By n-1 n 1 print(Bx, By) print Bx By Koch(Bx, By, Qx, Qy, n-1) Koch Bx By Qx Qy n-1 n 1 Px Px Py Py Qx Qx Qy Qy n n n = int(input()) n int(input()) int input() input print(0, 0.00000000) print 0 0.00000000 Koch(0.00000000, 0.00000000, 100.00000000, 0.00000000, n) Koch 0.00000000 0.00000000 100.00000000 0.00000000 n print(100.00000000, 0.00000000) print 100.00000000 0.00000000 def Koch(Px, Py, Qx, Qy, n) :
    if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1) def Koch(Px, Py, Qx, Qy, n) :
    if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1) Koch n = int(input()) int(input()) n
import math

def Koch(Px, Py, Qx, Qy, n) :
    if n == 0 :
        return
    else :
        Ax = (2 * Px + Qx) / 3
        Ay = (2 * Py + Qy) / 3
        Bx = (Px + 2 * Qx) / 3
        By = (Py + 2 * Qy) / 3
        Cx = Ax + (Bx - Ax) * math.cos(math.pi/3) - (By - Ay) * math.sin(math.pi/3) 
        Cy = Ay + (Bx - Ax) * math.sin(math.pi/3) + (By - Ay) * math.cos(math.pi/3)
        
        Koch(Px, Py, Ax, Ay, n-1)
        print(Ax, Ay)
        Koch(Ax, Ay, Cx, Cy, n-1)
        print(Cx, Cy)
        Koch(Cx, Cy, Bx, By, n-1)
        print(Bx, By)
        Koch(Bx, By, Qx, Qy, n-1)

n = int(input())
print(0, 0.00000000)
Koch(0.00000000, 0.00000000, 100.00000000, 0.00000000, n)
print(100.00000000, 0.00000000)

