

import math

def kock(n,p1x,p1y,p2x,p2y):
    if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y)

n=int(input().strip())

zero=0.0
hundred=100.0
print(zero,zero)
kock(n,0,0,100,0)
print(hundred,zero) import math math def kock(n,p1x,p1y,p2x,p2y):
    if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y) kock if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y) n==0 n 0 sx=(2*p1x+p2x)/3 sx (2*p1x+p2x)/3 2*p1x+p2x 2*p1x 2 p1x p2x 3 sy=(2*p1y+p2y)/3 sy (2*p1y+p2y)/3 2*p1y+p2y 2*p1y 2 p1y p2y 3 tx=(p1x+2*p2x)/3 tx (p1x+2*p2x)/3 p1x+2*p2x p1x 2*p2x 2 p2x 3 ty=(p1y+2*p2y)/3 ty (p1y+2*p2y)/3 p1y+2*p2y p1y 2*p2y 2 p2y 3 ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx ux (tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx (tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3) (tx-sx)*math.cos(math.pi*1/3) tx-sx tx sx math.cos(math.pi*1/3) math.cos math cos math.pi*1/3 math.pi*1 math.pi math pi 1 3 (ty-sy)*math.sin(math.pi*1/3) ty-sy ty sy math.sin(math.pi*1/3) math.sin math sin math.pi*1/3 math.pi*1 math.pi math pi 1 3 sx uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy uy (tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy (tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3) (tx-sx)*math.sin(math.pi*1/3) tx-sx tx sx math.sin(math.pi*1/3) math.sin math sin math.pi*1/3 math.pi*1 math.pi math pi 1 3 (ty-sy)*math.cos(math.pi*1/3) ty-sy ty sy math.cos(math.pi*1/3) math.cos math cos math.pi*1/3 math.pi*1 math.pi math pi 1 3 sy kock(n-1,p1x,p1y,sx,sy) kock n-1 n 1 p1x p1y sx sy print(sx,sy) print sx sy kock(n - 1, sx, sy, ux, uy) kock n - 1 n 1 sx sy ux uy print(ux,uy) print ux uy kock(n - 1, ux, uy, tx, ty) kock n - 1 n 1 ux uy tx ty print(tx,ty) print tx ty kock(n - 1, tx, ty, p2x, p2y) kock n - 1 n 1 tx ty p2x p2y n n p1x p1x p1y p1y p2x p2x p2y p2y n=int(input().strip()) n int(input().strip()) int input().strip() ().strip () input strip zero=0.0 zero 0.0 hundred=100.0 hundred 100.0 print(zero,zero) print zero zero kock(n,0,0,100,0) kock n 0 0 100 0 print(hundred,zero) print hundred zero def kock(n,p1x,p1y,p2x,p2y):
    if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y) def kock(n,p1x,p1y,p2x,p2y):
    if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y) kock hundred=100.0 100.0 hundred n=int(input().strip()) int(input().strip()) n zero=0.0 0.0 zero


import math

def kock(n,p1x,p1y,p2x,p2y):
    if n==0:
        pass
    else:
        sx=(2*p1x+p2x)/3
        sy=(2*p1y+p2y)/3
        tx=(p1x+2*p2x)/3
        ty=(p1y+2*p2y)/3

        ux=(tx-sx)*math.cos(math.pi*1/3)-(ty-sy)*math.sin(math.pi*1/3)+sx
        uy=(tx-sx)*math.sin(math.pi*1/3)+(ty-sy)*math.cos(math.pi*1/3)+sy

        kock(n-1,p1x,p1y,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, p2x, p2y)

n=int(input().strip())

zero=0.0
hundred=100.0
print(zero,zero)
kock(n,0,0,100,0)
print(hundred,zero)