from math import*
a=(0,0)
b=(100,0)

def koch(n,ax,ay,bx,by):
    if n==0:
        return 0
    th=pi/3
    sx=(2*ax+bx)/3
    sy=(2*ay+by)/3
    tx=(ax+2*bx)/3
    ty=(ay+2*by)/3
    ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx
    uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy
    
    koch(n-1,ax,ay,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,bx,by)


n=int(input())
print(*a)
koch(n,*a,*b)
print(*b) from math import* a=(0,0) a (0,0) 0 0 b=(100,0) b (100,0) 100 0 def koch(n,ax,ay,bx,by):
    if n==0:
        return 0
    th=pi/3
    sx=(2*ax+bx)/3
    sy=(2*ay+by)/3
    tx=(ax+2*bx)/3
    ty=(ay+2*by)/3
    ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx
    uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy
    
    koch(n-1,ax,ay,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,bx,by) koch if n==0:
        return 0
     n==0 n 0 return 0 0 th=pi/3 th pi/3 pi 3 sx=(2*ax+bx)/3 sx (2*ax+bx)/3 2*ax+bx 2*ax 2 ax bx 3 sy=(2*ay+by)/3 sy (2*ay+by)/3 2*ay+by 2*ay 2 ay by 3 tx=(ax+2*bx)/3 tx (ax+2*bx)/3 ax+2*bx ax 2*bx 2 bx 3 ty=(ay+2*by)/3 ty (ay+2*by)/3 ay+2*by ay 2*by 2 by 3 ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx ux (tx-sx)*cos(th)-(ty-sy)*sin(th)+sx (tx-sx)*cos(th)-(ty-sy)*sin(th) (tx-sx)*cos(th) tx-sx tx sx cos(th) cos th (ty-sy)*sin(th) ty-sy ty sy sin(th) sin th sx uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy uy (tx-sx)*sin(th)+(ty-sy)*cos(th)+sy (tx-sx)*sin(th)+(ty-sy)*cos(th) (tx-sx)*sin(th) tx-sx tx sx sin(th) sin th (ty-sy)*cos(th) ty-sy ty sy cos(th) cos th sy koch(n-1,ax,ay,sx,sy) koch n-1 n 1 ax ay sx sy print(sx,sy) print sx sy koch(n-1,sx,sy,ux,uy) koch n-1 n 1 sx sy ux uy print(ux,uy) print ux uy koch(n-1,ux,uy,tx,ty) koch n-1 n 1 ux uy tx ty print(tx,ty) print tx ty koch(n-1,tx,ty,bx,by) koch n-1 n 1 tx ty bx by n n ax ax ay ay bx bx by by n=int(input()) n int(input()) int input() input print(*a) print *a a koch(n,*a,*b) koch n *a a *b b print(*b) print *b b a=(0,0) (0,0) a n=int(input()) int(input()) n def koch(n,ax,ay,bx,by):
    if n==0:
        return 0
    th=pi/3
    sx=(2*ax+bx)/3
    sy=(2*ay+by)/3
    tx=(ax+2*bx)/3
    ty=(ay+2*by)/3
    ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx
    uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy
    
    koch(n-1,ax,ay,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,bx,by) def koch(n,ax,ay,bx,by):
    if n==0:
        return 0
    th=pi/3
    sx=(2*ax+bx)/3
    sy=(2*ay+by)/3
    tx=(ax+2*bx)/3
    ty=(ay+2*by)/3
    ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx
    uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy
    
    koch(n-1,ax,ay,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,bx,by) koch b=(100,0) (100,0) b
from math import*
a=(0,0)
b=(100,0)

def koch(n,ax,ay,bx,by):
    if n==0:
        return 0
    th=pi/3
    sx=(2*ax+bx)/3
    sy=(2*ay+by)/3
    tx=(ax+2*bx)/3
    ty=(ay+2*by)/3
    ux=(tx-sx)*cos(th)-(ty-sy)*sin(th)+sx
    uy=(tx-sx)*sin(th)+(ty-sy)*cos(th)+sy
    
    koch(n-1,ax,ay,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,bx,by)


n=int(input())
print(*a)
koch(n,*a,*b)
print(*b)
