import math

            

def koch(n, x1, y1, x2, y2):

  if n == 0:

    return

   

  theta60 = 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( theta60 ) - ( ty - sy ) * math.sin( theta60 ) + sx

  uy = ( tx - sx ) * math.sin( theta60 ) + ( ty - sy ) * math.cos( theta60 ) + 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 = eval(input())

            

p1x = float(0.)

p1y = float(0.)

p2x = float(100.)

p2y = float(0.)

            

print(p1x, p1y)

koch(n, p1x, p1y, p2x, p2y)

print(p2x, p2y)
import math



def kock(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



    kock(n-1, x1, y1, sx, sy)

    print(sx, sy)

    kock(n-1, sx, sy, ux, uy)

    print(ux, uy)

    kock(n-1, ux, uy, tx, ty)

    print(tx, ty)

    kock(n-1, tx, ty, x2, y2)



n = eval(input())



p1x = float(0.)

p1y = float(0.)

p2x = float(100.)

p2y = float(0.)



print(p1x, p1y)

kock(n, p1x, p1y, p2x, p2y)

print(p2x, p2y)
import math


def koch(n, x1, y1, x2, y2):
    if n == 0:
        return
    theta60 = 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(theta60) - (ty - sy) * math.sin(theta60) + sx
    uy = (tx - sx) * math.sin(theta60) + (ty - sy) * math.cos(theta60) + 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 = eval(input())
p1x = float(0.0)
p1y = float(0.0)
p2x = float(100.0)
p2y = float(0.0)
print(p1x, p1y)
koch(n, p1x, p1y, p2x, p2y)
print(p2x, p2y)

import math


def kock(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
    kock(n - 1, x1, y1, sx, sy)
    print(sx, sy)
    kock(n - 1, sx, sy, ux, uy)
    print(ux, uy)
    kock(n - 1, ux, uy, tx, ty)
    print(tx, ty)
    kock(n - 1, tx, ty, x2, y2)


n = eval(input())
p1x = float(0.0)
p1y = float(0.0)
p2x = float(100.0)
p2y = float(0.0)
print(p1x, p1y)
kock(n, p1x, p1y, p2x, p2y)
print(p2x, p2y)

-def koch(n, x1, y1, x2, y2): +def kock(n, x1, y1, x2, y2): -    theta60 = math.radians(60) +    angle = math.radians(60) -    ux = (tx - sx) * math.cos(theta60) - (ty - sy) * math.sin(theta60) + sx -    uy = (tx - sx) * math.sin(theta60) + (ty - sy) * math.cos(theta60) + sy -    koch(n - 1, x1, y1, sx, sy) +    ux = (tx - sx) * math.cos(angle) - (ty - sy) * math.sin(angle) + sx +    uy = (tx - sx) * math.sin(angle) + (ty - sy) * math.cos(angle) + sy +    kock(n - 1, x1, y1, sx, sy) -    koch(n - 1, sx, sy, ux, uy) +    kock(n - 1, sx, sy, ux, uy) -    koch(n - 1, ux, uy, tx, ty) +    kock(n - 1, ux, uy, tx, ty) -    koch(n - 1, tx, ty, x2, y2) +    kock(n - 1, tx, ty, x2, y2) -koch(n, p1x, p1y, p2x, p2y) +kock(n, p1x, p1y, p2x, p2y)