import math
 
def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
   
    angle = math.radians(60)
   
    sx = (2*x1 + x2)/3
    sy = (2*y1 + y2)/3
    tx = (2*x2 + x1)/3
    ty = (2*y2 + y1)/3
    ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx
    uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy
   
    koch(n-1, x1, y1, sx, sy)
    print sx, sy
    koch(n-1, sx, sy, ux, uy)
    print ux, uy
    koch(n-1, ux, uy, tx, ty)
    print tx, ty
    koch(n-1, tx, ty, x2, y2)
   
n = input()
   
p1x = 0.0
p1y = 0.0
p2x = 100.0
p2y = 0.0
   
print p1x, p1y
koch(n, p1x, p1y, p2x, p2y)
print p2x, p2y import math math def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
   
    angle = math.radians(60)
   
    sx = (2*x1 + x2)/3
    sy = (2*y1 + y2)/3
    tx = (2*x2 + x1)/3
    ty = (2*y2 + y1)/3
    ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx
    uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy
   
    koch(n-1, x1, y1, sx, sy)
    print sx, sy
    koch(n-1, sx, sy, ux, uy)
    print ux, uy
    koch(n-1, ux, uy, tx, ty)
    print tx, ty
    koch(n-1, tx, ty, x2, y2)
    koch if n == 0:
        return
   
     n == 0 n 0 return angle = math.radians(60) angle math.radians(60) math.radians math radians 60 sx = (2*x1 + x2)/3 sx (2*x1 + x2)/3 2*x1 + x2 2*x1 2 x1 x2 3 sy = (2*y1 + y2)/3 sy (2*y1 + y2)/3 2*y1 + y2 2*y1 2 y1 y2 3 tx = (2*x2 + x1)/3 tx (2*x2 + x1)/3 2*x2 + x1 2*x2 2 x2 x1 3 ty = (2*y2 + y1)/3 ty (2*y2 + y1)/3 2*y2 + y1 2*y2 2 y2 y1 3 ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx ux (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) (tx - sx)*math.cos(angle) tx - sx tx sx math.cos(angle) math.cos math cos angle (ty - sy)*math.sin(angle) ty - sy ty sy math.sin(angle) math.sin math sin angle sx uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy uy (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) (tx - sx)*math.sin(angle) tx - sx tx sx math.sin(angle) math.sin math sin angle (ty - sy)*math.cos(angle) ty - sy ty sy math.cos(angle) math.cos math cos angle sy koch(n-1, x1, y1, sx, sy) koch n-1 n 1 x1 y1 sx sy print sx sy koch(n-1, sx, sy, ux, uy) koch n-1 n 1 sx sy ux uy print ux uy koch(n-1, ux, uy, tx, ty) koch n-1 n 1 ux uy tx ty print tx ty koch(n-1, tx, ty, x2, y2) koch n-1 n 1 tx ty x2 y2 n n x1 x1 y1 y1 x2 x2 y2 y2 n = input() n input() input p1x = 0.0 p1x 0.0 p1y = 0.0 p1y 0.0 p2x = 100.0 p2x 100.0 p2y = 0.0 p2y 0.0 print p1x p1y koch(n, p1x, p1y, p2x, p2y) koch n p1x p1y p2x p2y print p2x p2y def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
   
    angle = math.radians(60)
   
    sx = (2*x1 + x2)/3
    sy = (2*y1 + y2)/3
    tx = (2*x2 + x1)/3
    ty = (2*y2 + y1)/3
    ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx
    uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy
   
    koch(n-1, x1, y1, sx, sy)
    print sx, sy
    koch(n-1, sx, sy, ux, uy)
    print ux, uy
    koch(n-1, ux, uy, tx, ty)
    print tx, ty
    koch(n-1, tx, ty, x2, y2)
    def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
   
    angle = math.radians(60)
   
    sx = (2*x1 + x2)/3
    sy = (2*y1 + y2)/3
    tx = (2*x2 + x1)/3
    ty = (2*y2 + y1)/3
    ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx
    uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy
   
    koch(n-1, x1, y1, sx, sy)
    print sx, sy
    koch(n-1, sx, sy, ux, uy)
    print ux, uy
    koch(n-1, ux, uy, tx, ty)
    print tx, ty
    koch(n-1, tx, ty, x2, y2)
    koch p1y = 0.0 0.0 p1y n = input() input() n p1x = 0.0 0.0 p1x p2y = 0.0 0.0 p2y p2x = 100.0 100.0 p2x
import math
 
def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
   
    angle = math.radians(60)
   
    sx = (2*x1 + x2)/3
    sy = (2*y1 + y2)/3
    tx = (2*x2 + x1)/3
    ty = (2*y2 + y1)/3
    ux = (tx - sx)*math.cos(angle) - (ty - sy)*math.sin(angle) + sx
    uy = (tx - sx)*math.sin(angle) + (ty - sy)*math.cos(angle) + sy
   
    koch(n-1, x1, y1, sx, sy)
    print sx, sy
    koch(n-1, sx, sy, ux, uy)
    print ux, uy
    koch(n-1, ux, uy, tx, ty)
    print tx, ty
    koch(n-1, tx, ty, x2, y2)
   
n = input()
   
p1x = 0.0
p1y = 0.0
p2x = 100.0
p2y = 0.0
   
print p1x, p1y
koch(n, p1x, p1y, p2x, p2y)
print p2x, p2y