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

def koch(d,p1,p2):
    if d == 0:
        return 
    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + p2[0] * 2) / 3
    ty = (p1[1] + p2[1] * 2) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c - dy * s + sx
    uy = dx * s + dy * c + sy

    koch(d-1,p1,(sx,sy))
    print("{0:.8f} {1:.8f}".format(sx,sy))

    koch(d-1,(sx,sy),(ux,uy))
    print("{0:.8f} {1:.8f}".format(ux,uy))

    koch(d-1,(ux,uy),(tx,ty))
    print("{0:.8f} {1:.8f}".format(tx,ty))

    koch(d-1,(tx,ty),p2)

n = int(input())
print("{0:.8f} {1:.8f}".format(0,0))
koch(n,(0,0),(100,0))
print("{0:.8f} {1:.8f}".format(100,0)) import math math c = math.cos(math.radians(60)) c math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s = math.sin(math.radians(60)) s math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 def koch(d,p1,p2):
    if d == 0:
        return 
    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + p2[0] * 2) / 3
    ty = (p1[1] + p2[1] * 2) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c - dy * s + sx
    uy = dx * s + dy * c + sy

    koch(d-1,p1,(sx,sy))
    print("{0:.8f} {1:.8f}".format(sx,sy))

    koch(d-1,(sx,sy),(ux,uy))
    print("{0:.8f} {1:.8f}".format(ux,uy))

    koch(d-1,(ux,uy),(tx,ty))
    print("{0:.8f} {1:.8f}".format(tx,ty))

    koch(d-1,(tx,ty),p2) koch if d == 0:
        return 
     d == 0 d 0 return sx = (2 * p1[0] + p2[0]) / 3 sx (2 * p1[0] + p2[0]) / 3 2 * p1[0] + p2[0] 2 * p1[0] 2 p1[0] p1 0 p2[0] p2 0 3 sy = (2 * p1[1] + p2[1]) / 3 sy (2 * p1[1] + p2[1]) / 3 2 * p1[1] + p2[1] 2 * p1[1] 2 p1[1] p1 1 p2[1] p2 1 3 tx = (p1[0] + p2[0] * 2) / 3 tx (p1[0] + p2[0] * 2) / 3 p1[0] + p2[0] * 2 p1[0] p1 0 p2[0] * 2 p2[0] p2 0 2 3 ty = (p1[1] + p2[1] * 2) / 3 ty (p1[1] + p2[1] * 2) / 3 p1[1] + p2[1] * 2 p1[1] p1 1 p2[1] * 2 p2[1] p2 1 2 3 dx = tx - sx dx tx - sx tx sx dy = ty - sy dy ty - sy ty sy ux = dx * c - dy * s + sx ux dx * c - dy * s + sx dx * c - dy * s dx * c dx c dy * s dy s sx uy = dx * s + dy * c + sy uy dx * s + dy * c + sy dx * s + dy * c dx * s dx s dy * c dy c sy koch(d-1,p1,(sx,sy)) koch d-1 d 1 p1 (sx,sy) sx sy print("{0:.8f} {1:.8f}".format(sx,sy)) print "{0:.8f} {1:.8f}".format(sx,sy) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format sx sy koch(d-1,(sx,sy),(ux,uy)) koch d-1 d 1 (sx,sy) sx sy (ux,uy) ux uy print("{0:.8f} {1:.8f}".format(ux,uy)) print "{0:.8f} {1:.8f}".format(ux,uy) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format ux uy koch(d-1,(ux,uy),(tx,ty)) koch d-1 d 1 (ux,uy) ux uy (tx,ty) tx ty print("{0:.8f} {1:.8f}".format(tx,ty)) print "{0:.8f} {1:.8f}".format(tx,ty) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format tx ty koch(d-1,(tx,ty),p2) koch d-1 d 1 (tx,ty) tx ty p2 d d p1 p1 p2 p2 n = int(input()) n int(input()) int input() input print("{0:.8f} {1:.8f}".format(0,0)) print "{0:.8f} {1:.8f}".format(0,0) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format 0 0 koch(n,(0,0),(100,0)) koch n (0,0) 0 0 (100,0) 100 0 print("{0:.8f} {1:.8f}".format(100,0)) print "{0:.8f} {1:.8f}".format(100,0) "{0:.8f} {1:.8f}".format "{0:.8f} {1:.8f}" format 100 0 c = math.cos(math.radians(60)) math.cos(math.radians(60)) c s = math.sin(math.radians(60)) math.sin(math.radians(60)) s n = int(input()) int(input()) n def koch(d,p1,p2):
    if d == 0:
        return 
    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + p2[0] * 2) / 3
    ty = (p1[1] + p2[1] * 2) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c - dy * s + sx
    uy = dx * s + dy * c + sy

    koch(d-1,p1,(sx,sy))
    print("{0:.8f} {1:.8f}".format(sx,sy))

    koch(d-1,(sx,sy),(ux,uy))
    print("{0:.8f} {1:.8f}".format(ux,uy))

    koch(d-1,(ux,uy),(tx,ty))
    print("{0:.8f} {1:.8f}".format(tx,ty))

    koch(d-1,(tx,ty),p2) def koch(d,p1,p2):
    if d == 0:
        return 
    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + p2[0] * 2) / 3
    ty = (p1[1] + p2[1] * 2) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c - dy * s + sx
    uy = dx * s + dy * c + sy

    koch(d-1,p1,(sx,sy))
    print("{0:.8f} {1:.8f}".format(sx,sy))

    koch(d-1,(sx,sy),(ux,uy))
    print("{0:.8f} {1:.8f}".format(ux,uy))

    koch(d-1,(ux,uy),(tx,ty))
    print("{0:.8f} {1:.8f}".format(tx,ty))

    koch(d-1,(tx,ty),p2) koch
import math 
c = math.cos(math.radians(60))
s = math.sin(math.radians(60))

def koch(d,p1,p2):
    if d == 0:
        return 
    sx = (2 * p1[0] + p2[0]) / 3
    sy = (2 * p1[1] + p2[1]) / 3

    tx = (p1[0] + p2[0] * 2) / 3
    ty = (p1[1] + p2[1] * 2) / 3

    dx = tx - sx
    dy = ty - sy

    ux = dx * c - dy * s + sx
    uy = dx * s + dy * c + sy

    koch(d-1,p1,(sx,sy))
    print("{0:.8f} {1:.8f}".format(sx,sy))

    koch(d-1,(sx,sy),(ux,uy))
    print("{0:.8f} {1:.8f}".format(ux,uy))

    koch(d-1,(ux,uy),(tx,ty))
    print("{0:.8f} {1:.8f}".format(tx,ty))

    koch(d-1,(tx,ty),p2)

n = int(input())
print("{0:.8f} {1:.8f}".format(0,0))
koch(n,(0,0),(100,0))
print("{0:.8f} {1:.8f}".format(100,0))
