def Rot(vec):
    new=[]
    new+=[vec[0]/2-vec[1]*3**(1/2)/2]
    new+=[vec[0]*3**(1/2)/2+vec[1]/2]
    return(new)

def Add(L):
    dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3]
    vec1=Rot(dist)
    p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]]
    p2=[p1[0]+vec1[0],p1[1]+vec1[1]]
    p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]]
    return([L[0],p1,p2,p3,L[1]])

def Koch(L,n):
    l=len(L)
    if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

    return(Out)

n=int(input())
L=Koch([[0,0],[100,0]],n)
l=len(L)
for i in range(l):
    print(L[i][0],L[i][1])
 def Rot(vec):
    new=[]
    new+=[vec[0]/2-vec[1]*3**(1/2)/2]
    new+=[vec[0]*3**(1/2)/2+vec[1]/2]
    return(new) Rot new=[] new [] new+=[vec[0]/2-vec[1]*3**(1/2)/2] new [vec[0]/2-vec[1]*3**(1/2)/2] vec[0]/2-vec[1]*3**(1/2)/2 vec[0]/2 vec[0] vec 0 2 vec[1]*3**(1/2)/2 vec[1]*3**(1/2) vec[1] vec 1 3**(1/2) 3 1/2 1 2 2 new+=[vec[0]*3**(1/2)/2+vec[1]/2] new [vec[0]*3**(1/2)/2+vec[1]/2] vec[0]*3**(1/2)/2+vec[1]/2 vec[0]*3**(1/2)/2 vec[0]*3**(1/2) vec[0] vec 0 3**(1/2) 3 1/2 1 2 2 vec[1]/2 vec[1] vec 1 2 return(new) new vec vec def Add(L):
    dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3]
    vec1=Rot(dist)
    p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]]
    p2=[p1[0]+vec1[0],p1[1]+vec1[1]]
    p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]]
    return([L[0],p1,p2,p3,L[1]]) Add dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3] dist [(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3] (L[1][0]-L[0][0])/3 L[1][0]-L[0][0] L[1][0] [1] L 1 0 L[0][0] [0] L 0 0 3 (L[1][1]-L[0][1])/3 L[1][1]-L[0][1] L[1][1] [1] L 1 1 L[0][1] [0] L 0 1 3 vec1=Rot(dist) vec1 Rot(dist) Rot dist p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]] p1 [2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]] 2/3*L[0][0]+1/3*L[1][0] 2/3*L[0][0] 2/3 2 3 L[0][0] [0] L 0 0 1/3*L[1][0] 1/3 1 3 L[1][0] [1] L 1 0 2/3*L[0][1]+1/3*L[1][1] 2/3*L[0][1] 2/3 2 3 L[0][1] [0] L 0 1 1/3*L[1][1] 1/3 1 3 L[1][1] [1] L 1 1 p2=[p1[0]+vec1[0],p1[1]+vec1[1]] p2 [p1[0]+vec1[0],p1[1]+vec1[1]] p1[0]+vec1[0] p1[0] p1 0 vec1[0] vec1 0 p1[1]+vec1[1] p1[1] p1 1 vec1[1] vec1 1 p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]] p3 [2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]] 2/3*L[1][0]+1/3*L[0][0] 2/3*L[1][0] 2/3 2 3 L[1][0] [1] L 1 0 1/3*L[0][0] 1/3 1 3 L[0][0] [0] L 0 0 2/3*L[1][1]+1/3*L[0][1] 2/3*L[1][1] 2/3 2 3 L[1][1] [1] L 1 1 1/3*L[0][1] 1/3 1 3 L[0][1] [0] L 0 1 return([L[0],p1,p2,p3,L[1]]) [L[0],p1,p2,p3,L[1]] L[0] L 0 p1 p2 p3 L[1] L 1 L L def Koch(L,n):
    l=len(L)
    if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

    return(Out) Koch l=len(L) l len(L) len L if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

     n==0 n 0 Out=L Out L elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
     n==1 n 1 if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
     l==2 l 2 Out=Add(L) Out Add(L) Add L L1=L[0:l//2+1] L1 L[0:l//2+1] L 0:l//2+1 0 l//2+1 l//2 l 2 1 L2=L[l//2:l] L2 L[l//2:l] L l//2:l l//2 l 2 l Out=Koch(L1,n)[:-1]+Koch(L2,n) Out Koch(L1,n)[:-1]+Koch(L2,n) Koch(L1,n)[:-1] (L1,n) Koch L1 n :-1 -1 Koch(L2,n) Koch L2 n Out=(Koch(Koch(L,n-1),1)) Out Koch(Koch(L,n-1),1) Koch Koch(L,n-1) Koch L n-1 n 1 1 return(Out) Out L L n n n=int(input()) n int(input()) int input() input L=Koch([[0,0],[100,0]],n) L Koch([[0,0],[100,0]],n) Koch [[0,0],[100,0]] [0,0] 0 0 [100,0] 100 0 n l=len(L) l len(L) len L for i in range(l):
    print(L[i][0],L[i][1]) i range(l) range l print(L[i][0],L[i][1]) print L[i][0] [i] L i 0 L[i][1] [i] L i 1 n=int(input()) int(input()) n def Add(L):
    dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3]
    vec1=Rot(dist)
    p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]]
    p2=[p1[0]+vec1[0],p1[1]+vec1[1]]
    p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]]
    return([L[0],p1,p2,p3,L[1]]) def Add(L):
    dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3]
    vec1=Rot(dist)
    p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]]
    p2=[p1[0]+vec1[0],p1[1]+vec1[1]]
    p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]]
    return([L[0],p1,p2,p3,L[1]]) Add L=Koch([[0,0],[100,0]],n) Koch([[0,0],[100,0]],n) L l=len(L) len(L) l def Koch(L,n):
    l=len(L)
    if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

    return(Out) def Koch(L,n):
    l=len(L)
    if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

    return(Out) Koch def Rot(vec):
    new=[]
    new+=[vec[0]/2-vec[1]*3**(1/2)/2]
    new+=[vec[0]*3**(1/2)/2+vec[1]/2]
    return(new) def Rot(vec):
    new=[]
    new+=[vec[0]/2-vec[1]*3**(1/2)/2]
    new+=[vec[0]*3**(1/2)/2+vec[1]/2]
    return(new) Rot
def Rot(vec):
    new=[]
    new+=[vec[0]/2-vec[1]*3**(1/2)/2]
    new+=[vec[0]*3**(1/2)/2+vec[1]/2]
    return(new)

def Add(L):
    dist=[(L[1][0]-L[0][0])/3,(L[1][1]-L[0][1])/3]
    vec1=Rot(dist)
    p1=[2/3*L[0][0]+1/3*L[1][0],2/3*L[0][1]+1/3*L[1][1]]
    p2=[p1[0]+vec1[0],p1[1]+vec1[1]]
    p3=[2/3*L[1][0]+1/3*L[0][0],2/3*L[1][1]+1/3*L[0][1]]
    return([L[0],p1,p2,p3,L[1]])

def Koch(L,n):
    l=len(L)
    if n==0:
        Out=L
    elif n==1:
        if l==2:
            Out=Add(L)
        else:
            L1=L[0:l//2+1]
            L2=L[l//2:l]

            Out=Koch(L1,n)[:-1]+Koch(L2,n)
    else:
        Out=(Koch(Koch(L,n-1),1))

    return(Out)

n=int(input())
L=Koch([[0,0],[100,0]],n)
l=len(L)
for i in range(l):
    print(L[i][0],L[i][1])

