import math
cos = math.cos(math.radians(60))
sin = math.sin(math.radians(60))

def koch(count, p1x, p1y, p2x, p2y):
    global cos
    global sin
    if count == 0:
        return
    sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3
    tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3
    ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty)

    koch(count-1, p1x ,p1y, sx, sy)
    print(sx, sy)
    koch(count-1, sx, sy, ux, uy)
    print(ux, uy)
    koch(count-1, ux, uy, tx, ty)
    print(tx, ty)
    koch(count-1, tx, ty, p2x, p2y)

n = int(input())
print(0, 0)
koch(n, 0, 0, 100, 0)
print(100, 0) import math math cos = math.cos(math.radians(60)) cos math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sin = math.sin(math.radians(60)) sin math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 def koch(count, p1x, p1y, p2x, p2y):
    global cos
    global sin
    if count == 0:
        return
    sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3
    tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3
    ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty)

    koch(count-1, p1x ,p1y, sx, sy)
    print(sx, sy)
    koch(count-1, sx, sy, ux, uy)
    print(ux, uy)
    koch(count-1, ux, uy, tx, ty)
    print(tx, ty)
    koch(count-1, tx, ty, p2x, p2y) koch global cos global sin if count == 0:
        return
     count == 0 count 0 return sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3 sx (2*p1x + p2x)/3 2*p1x + p2x 2*p1x 2 p1x p2x 3 sy (2*p1y + p2y)/3 2*p1y + p2y 2*p1y 2 p1y p2y 3 tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3 tx (p1x + 2*p2x)/3 p1x + 2*p2x p1x 2*p2x 2 p2x 3 ty (p1y + 2*p2y)/3 p1y + 2*p2y p1y 2*p2y 2 p2y 3 ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty) ux cos*(sx + tx) - sin*(ty - sy) cos*(sx + tx) cos sx + tx sx tx sin*(ty - sy) sin ty - sy ty sy uy sin*(tx - sx) + cos*(sy + ty) sin*(tx - sx) sin tx - sx tx sx cos*(sy + ty) cos sy + ty sy ty koch(count-1, p1x ,p1y, sx, sy) koch count-1 count 1 p1x p1y sx sy print(sx, sy) print sx sy koch(count-1, sx, sy, ux, uy) koch count-1 count 1 sx sy ux uy print(ux, uy) print ux uy koch(count-1, ux, uy, tx, ty) koch count-1 count 1 ux uy tx ty print(tx, ty) print tx ty koch(count-1, tx, ty, p2x, p2y) koch count-1 count 1 tx ty p2x p2y count count p1x p1x p1y p1y p2x p2x p2y p2y n = int(input()) n int(input()) int input() input print(0, 0) print 0 0 koch(n, 0, 0, 100, 0) koch n 0 0 100 0 print(100, 0) print 100 0 sin = math.sin(math.radians(60)) math.sin(math.radians(60)) sin cos = math.cos(math.radians(60)) math.cos(math.radians(60)) cos n = int(input()) int(input()) n def koch(count, p1x, p1y, p2x, p2y):
    global cos
    global sin
    if count == 0:
        return
    sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3
    tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3
    ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty)

    koch(count-1, p1x ,p1y, sx, sy)
    print(sx, sy)
    koch(count-1, sx, sy, ux, uy)
    print(ux, uy)
    koch(count-1, ux, uy, tx, ty)
    print(tx, ty)
    koch(count-1, tx, ty, p2x, p2y) def koch(count, p1x, p1y, p2x, p2y):
    global cos
    global sin
    if count == 0:
        return
    sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3
    tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3
    ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty)

    koch(count-1, p1x ,p1y, sx, sy)
    print(sx, sy)
    koch(count-1, sx, sy, ux, uy)
    print(ux, uy)
    koch(count-1, ux, uy, tx, ty)
    print(tx, ty)
    koch(count-1, tx, ty, p2x, p2y) koch
import math
cos = math.cos(math.radians(60))
sin = math.sin(math.radians(60))

def koch(count, p1x, p1y, p2x, p2y):
    global cos
    global sin
    if count == 0:
        return
    sx, sy = (2*p1x + p2x)/3, (2*p1y + p2y)/3
    tx, ty = (p1x + 2*p2x)/3, (p1y + 2*p2y)/3
    ux, uy = cos*(sx + tx) - sin*(ty - sy), sin*(tx - sx) + cos*(sy + ty)

    koch(count-1, p1x ,p1y, sx, sy)
    print(sx, sy)
    koch(count-1, sx, sy, ux, uy)
    print(ux, uy)
    koch(count-1, ux, uy, tx, ty)
    print(tx, ty)
    koch(count-1, tx, ty, p2x, p2y)

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