import math

def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

    
def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
    

n = int(input())

p1 = (0.0, 0.0)
p2 = (100.0, 0.0)

myPrint(p1)
koch(p1, p2, n)
myPrint(p2) import math math def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

     koch if dp == 0:
        return
    
     dp == 0 dp 0 return sX = (p2[0] - p1[0]) / 3 + p1[0] sX (p2[0] - p1[0]) / 3 + p1[0] (p2[0] - p1[0]) / 3 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 3 p1[0] p1 0 sY = (p2[1] - p1[1]) / 3 + p1[1] sY (p2[1] - p1[1]) / 3 + p1[1] (p2[1] - p1[1]) / 3 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 3 p1[1] p1 1 s = (sX, sY) s (sX, sY) sX sY tX = (p2[0] - p1[0]) * 2 / 3 + p1[0] tX (p2[0] - p1[0]) * 2 / 3 + p1[0] (p2[0] - p1[0]) * 2 / 3 (p2[0] - p1[0]) * 2 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 2 3 p1[0] p1 0 tY = (p2[1] - p1[1]) * 2 / 3 + p1[1] tY (p2[1] - p1[1]) * 2 / 3 + p1[1] (p2[1] - p1[1]) * 2 / 3 (p2[1] - p1[1]) * 2 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 2 3 p1[1] p1 1 t = (tX, tY) t (tX, tY) tX tY uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX uX (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) (tX - sX) * math.cos(math.radians(60)) tX - sX tX sX math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (tY - sY) * math.sin(math.radians(60)) tY - sY tY sY math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 sX uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY uY (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) (tX - sX) * math.sin(math.radians(60)) tX - sX tX sX math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (tY - sY) * math.cos(math.radians(60)) tY - sY tY sY math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sY u = (uX, uY) u (uX, uY) uX uY koch(p1, s, dp - 1) koch p1 s dp - 1 dp 1 myPrint(s) myPrint s koch(s, u, dp - 1) koch s u dp - 1 dp 1 myPrint(u) myPrint u koch(u, t, dp - 1) koch u t dp - 1 dp 1 myPrint(t) myPrint t koch(t, p2, dp - 1) koch t p2 dp - 1 dp 1 p1 p1 p2 p2 dp dp def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
     myPrint print("{:.8f} {:.8f}".format(val[0], val[1])) print "{:.8f} {:.8f}".format(val[0], val[1]) "{:.8f} {:.8f}".format "{:.8f} {:.8f}" format val[0] val 0 val[1] val 1 val val n = int(input()) n int(input()) int input() input 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 myPrint(p1) myPrint p1 koch(p1, p2, n) koch p1 p2 n myPrint(p2) myPrint p2 def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
     def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
     myPrint p1 = (0.0, 0.0) (0.0, 0.0) p1 def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

     def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

     koch p2 = (100.0, 0.0) (100.0, 0.0) p2 n = int(input()) int(input()) n
import math

def koch(p1, p2, dp):

    if dp == 0:
        return
    
    sX = (p2[0] - p1[0]) / 3 + p1[0]
    sY = (p2[1] - p1[1]) / 3 + p1[1]
    s = (sX, sY)

    tX = (p2[0] - p1[0]) * 2 / 3 + p1[0]
    tY = (p2[1] - p1[1]) * 2 / 3 + p1[1]
    t = (tX, tY)

    uX = (tX - sX) * math.cos(math.radians(60)) - (tY - sY) * math.sin(math.radians(60)) + sX
    uY = (tX - sX) * math.sin(math.radians(60)) + (tY - sY) * math.cos(math.radians(60)) + sY
    u = (uX, uY)

    koch(p1, s, dp - 1)
    myPrint(s)
    koch(s, u, dp - 1)
    myPrint(u)
    koch(u, t, dp - 1)
    myPrint(t)
    koch(t, p2, dp - 1)

    
def myPrint(val):
    print("{:.8f} {:.8f}".format(val[0], val[1]))
    

n = int(input())

p1 = (0.0, 0.0)
p2 = (100.0, 0.0)

myPrint(p1)
koch(p1, p2, n)
myPrint(p2)
