#coding:utf-8
#1_5_C
import math

def koch(n, p1x, p1y, p2x, p2y):
    if n == 0:
        return

    sx = (2*p1x + 1*p2x)/3
    sy = (2*p1y + 1*p2y)/3
    tx = (1*p1x + 2*p2x)/3
    ty = (1*p1y + 2*p2y)/3
    theta = math.pi/3
    ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx
    uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy

    koch(n-1, p1x, p1y, sx, sy)
    print("{:.5f} {:.5f}".format(sx, sy))
    koch(n-1, sx, sy, ux, uy)
    print("{:.5f} {:.5f}".format(ux, uy))
    koch(n-1, ux, uy, tx, ty)
    print("{:.5f} {:.5f}".format(tx, ty))
    koch(n-1, tx, ty, p2x, p2y)

n = int(input())
p1x, p1y = 0.0, 0.0
p2x, p2y = 100.0, 0.0
print("{:.5f} {:.5f}".format(p1x, p1y))
koch(n, p1x, p1y, p2x, p2y)
print("{:.5f} {:.5f}".format(p2x, p2y)) import math math def koch(n, p1x, p1y, p2x, p2y):
    if n == 0:
        return

    sx = (2*p1x + 1*p2x)/3
    sy = (2*p1y + 1*p2y)/3
    tx = (1*p1x + 2*p2x)/3
    ty = (1*p1y + 2*p2y)/3
    theta = math.pi/3
    ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx
    uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy

    koch(n-1, p1x, p1y, sx, sy)
    print("{:.5f} {:.5f}".format(sx, sy))
    koch(n-1, sx, sy, ux, uy)
    print("{:.5f} {:.5f}".format(ux, uy))
    koch(n-1, ux, uy, tx, ty)
    print("{:.5f} {:.5f}".format(tx, ty))
    koch(n-1, tx, ty, p2x, p2y) koch if n == 0:
        return

     n == 0 n 0 return sx = (2*p1x + 1*p2x)/3 sx (2*p1x + 1*p2x)/3 2*p1x + 1*p2x 2*p1x 2 p1x 1*p2x 1 p2x 3 sy = (2*p1y + 1*p2y)/3 sy (2*p1y + 1*p2y)/3 2*p1y + 1*p2y 2*p1y 2 p1y 1*p2y 1 p2y 3 tx = (1*p1x + 2*p2x)/3 tx (1*p1x + 2*p2x)/3 1*p1x + 2*p2x 1*p1x 1 p1x 2*p2x 2 p2x 3 ty = (1*p1y + 2*p2y)/3 ty (1*p1y + 2*p2y)/3 1*p1y + 2*p2y 1*p1y 1 p1y 2*p2y 2 p2y 3 theta = math.pi/3 theta math.pi/3 math.pi math pi 3 ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx ux math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) math.cos(theta)*(tx-sx) math.cos(theta) math.cos math cos theta tx-sx tx sx math.sin(theta)*(ty-sy) math.sin(theta) math.sin math sin theta ty-sy ty sy sx uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy uy math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) math.sin(theta)*(tx-sx) math.sin(theta) math.sin math sin theta tx-sx tx sx math.cos(theta)*(ty-sy) math.cos(theta) math.cos math cos theta ty-sy ty sy sy koch(n-1, p1x, p1y, sx, sy) koch n-1 n 1 p1x p1y sx sy print("{:.5f} {:.5f}".format(sx, sy)) print "{:.5f} {:.5f}".format(sx, sy) "{:.5f} {:.5f}".format "{:.5f} {:.5f}" format sx sy koch(n-1, sx, sy, ux, uy) koch n-1 n 1 sx sy ux uy print("{:.5f} {:.5f}".format(ux, uy)) print "{:.5f} {:.5f}".format(ux, uy) "{:.5f} {:.5f}".format "{:.5f} {:.5f}" format ux uy koch(n-1, ux, uy, tx, ty) koch n-1 n 1 ux uy tx ty print("{:.5f} {:.5f}".format(tx, ty)) print "{:.5f} {:.5f}".format(tx, ty) "{:.5f} {:.5f}".format "{:.5f} {:.5f}" format tx ty koch(n-1, tx, ty, p2x, p2y) koch n-1 n 1 tx ty p2x p2y n n p1x p1x p1y p1y p2x p2x p2y p2y n = int(input()) n int(input()) int input() input p1x, p1y = 0.0, 0.0 p1x 0.0 p1y 0.0 p2x, p2y = 100.0, 0.0 p2x 100.0 p2y 0.0 print("{:.5f} {:.5f}".format(p1x, p1y)) print "{:.5f} {:.5f}".format(p1x, p1y) "{:.5f} {:.5f}".format "{:.5f} {:.5f}" format p1x p1y koch(n, p1x, p1y, p2x, p2y) koch n p1x p1y p2x p2y print("{:.5f} {:.5f}".format(p2x, p2y)) print "{:.5f} {:.5f}".format(p2x, p2y) "{:.5f} {:.5f}".format "{:.5f} {:.5f}" format p2x p2y def koch(n, p1x, p1y, p2x, p2y):
    if n == 0:
        return

    sx = (2*p1x + 1*p2x)/3
    sy = (2*p1y + 1*p2y)/3
    tx = (1*p1x + 2*p2x)/3
    ty = (1*p1y + 2*p2y)/3
    theta = math.pi/3
    ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx
    uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy

    koch(n-1, p1x, p1y, sx, sy)
    print("{:.5f} {:.5f}".format(sx, sy))
    koch(n-1, sx, sy, ux, uy)
    print("{:.5f} {:.5f}".format(ux, uy))
    koch(n-1, ux, uy, tx, ty)
    print("{:.5f} {:.5f}".format(tx, ty))
    koch(n-1, tx, ty, p2x, p2y) def koch(n, p1x, p1y, p2x, p2y):
    if n == 0:
        return

    sx = (2*p1x + 1*p2x)/3
    sy = (2*p1y + 1*p2y)/3
    tx = (1*p1x + 2*p2x)/3
    ty = (1*p1y + 2*p2y)/3
    theta = math.pi/3
    ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx
    uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy

    koch(n-1, p1x, p1y, sx, sy)
    print("{:.5f} {:.5f}".format(sx, sy))
    koch(n-1, sx, sy, ux, uy)
    print("{:.5f} {:.5f}".format(ux, uy))
    koch(n-1, ux, uy, tx, ty)
    print("{:.5f} {:.5f}".format(tx, ty))
    koch(n-1, tx, ty, p2x, p2y) koch p1x, p1y = 0.0, 0.0 0.0 p1x p2y = 100.0, 0.0 0.0 p2y n = int(input()) int(input()) n p1y = 0.0, 0.0 0.0 p1y p2x, p2y = 100.0, 0.0 100.0 p2x
#coding:utf-8
#1_5_C
import math

def koch(n, p1x, p1y, p2x, p2y):
    if n == 0:
        return

    sx = (2*p1x + 1*p2x)/3
    sy = (2*p1y + 1*p2y)/3
    tx = (1*p1x + 2*p2x)/3
    ty = (1*p1y + 2*p2y)/3
    theta = math.pi/3
    ux = math.cos(theta)*(tx-sx) - math.sin(theta)*(ty-sy) + sx
    uy = math.sin(theta)*(tx-sx) + math.cos(theta)*(ty-sy) + sy

    koch(n-1, p1x, p1y, sx, sy)
    print("{:.5f} {:.5f}".format(sx, sy))
    koch(n-1, sx, sy, ux, uy)
    print("{:.5f} {:.5f}".format(ux, uy))
    koch(n-1, ux, uy, tx, ty)
    print("{:.5f} {:.5f}".format(tx, ty))
    koch(n-1, tx, ty, p2x, p2y)

n = int(input())
p1x, p1y = 0.0, 0.0
p2x, p2y = 100.0, 0.0
print("{:.5f} {:.5f}".format(p1x, p1y))
koch(n, p1x, p1y, p2x, p2y)
print("{:.5f} {:.5f}".format(p2x, p2y))