from math import sqrt, sin, cos

def readinput():
    n=int(input())
    return n

def apex3(x1,y1,x2,y2):
    '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    '''
    x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1
    y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1
    return x3,y3

def koch(x1,y1,x2,y2,l,lmax):
    #print('l:{}, lmax:{}'.format(l,lmax))
    if(l==lmax):
        return

    x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1
    x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1
    x5,y5 = apex3(x3,y3,x4,y4)

    koch(x1,y1,x3,y3,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x3,y3))
    koch(x3,y3,x5,y5,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x5,y5))
    koch(x5,y5,x4,y4,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x4,y4))
    koch(x4,y4,x2,y2,l+1,lmax)

    return

def main(n):
    x0=0;y0=0
    x1=100;y1=0
    print('{:.10f} {:.10f}'.format(x0,y0))
    koch(x0,y0,x1,y1,0,n)
    print('{:.10f} {:.10f}'.format(x1,y1))


if __name__=='__main__':
    n=readinput()
    main(n)
 from math import sqrt, sin, cos def readinput():
    n=int(input())
    return n readinput n=int(input()) n int(input()) int input() input return n n def apex3(x1,y1,x2,y2):
    '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    '''
    x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1
    y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1
    return x3,y3 apex3 '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    ''' x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1 x3 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) 1.0/2.0 *(x2-x1) 1.0/2.0 1.0 2.0 x2-x1 x2 x1 sqrt(3.0)/2.0 * (y2-y1) sqrt(3.0)/2.0 sqrt(3.0) sqrt 3.0 2.0 y2-y1 y2 y1 x1 y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1 y3 sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1 sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) sqrt(3.0)/2.0 * (x2-x1) sqrt(3.0)/2.0 sqrt(3.0) sqrt 3.0 2.0 x2-x1 x2 x1 1.0/2.0 * (y2-y1) 1.0/2.0 1.0 2.0 y2-y1 y2 y1 y1 return x3,y3 return x3,y3 x3 y3 x1 x1 y1 y1 x2 x2 y2 y2 def koch(x1,y1,x2,y2,l,lmax):
    #print('l:{}, lmax:{}'.format(l,lmax))
    if(l==lmax):
        return

    x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1
    x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1
    x5,y5 = apex3(x3,y3,x4,y4)

    koch(x1,y1,x3,y3,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x3,y3))
    koch(x3,y3,x5,y5,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x5,y5))
    koch(x5,y5,x4,y4,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x4,y4))
    koch(x4,y4,x2,y2,l+1,lmax)

    return koch if(l==lmax):
        return

     l==lmax l lmax return x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1 x3 (x2-x1)/3 +x1 (x2-x1)/3 x2-x1 x2 x1 3 x1 y3 (y2-y1)/3 +y1 (y2-y1)/3 y2-y1 y2 y1 3 y1 x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1 x4 (x2-x1)/3*2 +x1 (x2-x1)/3*2 (x2-x1)/3 x2-x1 x2 x1 3 2 x1 y4 (y2-y1)/3*2 +y1 (y2-y1)/3*2 (y2-y1)/3 y2-y1 y2 y1 3 2 y1 x5,y5 = apex3(x3,y3,x4,y4) x5 apex3(x3,y3,x4,y4) apex3 x3 y3 x4 y4 y5 koch(x1,y1,x3,y3,l+1,lmax) koch x1 y1 x3 y3 l+1 l 1 lmax print('{:.10f} {:.10f}'.format(x3,y3)) print '{:.10f} {:.10f}'.format(x3,y3) '{:.10f} {:.10f}'.format '{:.10f} {:.10f}' format x3 y3 koch(x3,y3,x5,y5,l+1,lmax) koch x3 y3 x5 y5 l+1 l 1 lmax print('{:.10f} {:.10f}'.format(x5,y5)) print '{:.10f} {:.10f}'.format(x5,y5) '{:.10f} {:.10f}'.format '{:.10f} {:.10f}' format x5 y5 koch(x5,y5,x4,y4,l+1,lmax) koch x5 y5 x4 y4 l+1 l 1 lmax print('{:.10f} {:.10f}'.format(x4,y4)) print '{:.10f} {:.10f}'.format(x4,y4) '{:.10f} {:.10f}'.format '{:.10f} {:.10f}' format x4 y4 koch(x4,y4,x2,y2,l+1,lmax) koch x4 y4 x2 y2 l+1 l 1 lmax return x1 x1 y1 y1 x2 x2 y2 y2 l l lmax lmax def main(n):
    x0=0;y0=0
    x1=100;y1=0
    print('{:.10f} {:.10f}'.format(x0,y0))
    koch(x0,y0,x1,y1,0,n)
    print('{:.10f} {:.10f}'.format(x1,y1)) main x0=0 x0 0 y0=0 y0 0 x1=100 x1 100 y1=0 y1 0 print('{:.10f} {:.10f}'.format(x0,y0)) print '{:.10f} {:.10f}'.format(x0,y0) '{:.10f} {:.10f}'.format '{:.10f} {:.10f}' format x0 y0 koch(x0,y0,x1,y1,0,n) koch x0 y0 x1 y1 0 n print('{:.10f} {:.10f}'.format(x1,y1)) print '{:.10f} {:.10f}'.format(x1,y1) '{:.10f} {:.10f}'.format '{:.10f} {:.10f}' format x1 y1 n n if __name__=='__main__':
    n=readinput()
    main(n) __name__=='__main__' __name__ '__main__' n=readinput() n readinput() readinput main(n) main n def main(n):
    x0=0;y0=0
    x1=100;y1=0
    print('{:.10f} {:.10f}'.format(x0,y0))
    koch(x0,y0,x1,y1,0,n)
    print('{:.10f} {:.10f}'.format(x1,y1)) def main(n):
    x0=0;y0=0
    x1=100;y1=0
    print('{:.10f} {:.10f}'.format(x0,y0))
    koch(x0,y0,x1,y1,0,n)
    print('{:.10f} {:.10f}'.format(x1,y1)) main def koch(x1,y1,x2,y2,l,lmax):
    #print('l:{}, lmax:{}'.format(l,lmax))
    if(l==lmax):
        return

    x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1
    x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1
    x5,y5 = apex3(x3,y3,x4,y4)

    koch(x1,y1,x3,y3,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x3,y3))
    koch(x3,y3,x5,y5,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x5,y5))
    koch(x5,y5,x4,y4,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x4,y4))
    koch(x4,y4,x2,y2,l+1,lmax)

    return def koch(x1,y1,x2,y2,l,lmax):
    #print('l:{}, lmax:{}'.format(l,lmax))
    if(l==lmax):
        return

    x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1
    x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1
    x5,y5 = apex3(x3,y3,x4,y4)

    koch(x1,y1,x3,y3,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x3,y3))
    koch(x3,y3,x5,y5,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x5,y5))
    koch(x5,y5,x4,y4,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x4,y4))
    koch(x4,y4,x2,y2,l+1,lmax)

    return koch def readinput():
    n=int(input())
    return n def readinput():
    n=int(input())
    return n readinput def apex3(x1,y1,x2,y2):
    '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    '''
    x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1
    y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1
    return x3,y3 def apex3(x1,y1,x2,y2):
    '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    '''
    x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1
    y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1
    return x3,y3 apex3 n=readinput() readinput() n
from math import sqrt, sin, cos

def readinput():
    n=int(input())
    return n

def apex3(x1,y1,x2,y2):
    '''正三角形の残りの頂点(x3,y3)を求める
    
    1->2->3の順に反時計回り
    '''
    x3 = 1.0/2.0 *(x2-x1) -sqrt(3.0)/2.0 * (y2-y1) +x1
    y3 = sqrt(3.0)/2.0 * (x2-x1) + 1.0/2.0 * (y2-y1) +y1
    return x3,y3

def koch(x1,y1,x2,y2,l,lmax):
    #print('l:{}, lmax:{}'.format(l,lmax))
    if(l==lmax):
        return

    x3,y3=(x2-x1)/3 +x1, (y2-y1)/3 +y1
    x4,y4=(x2-x1)/3*2 +x1, (y2-y1)/3*2 +y1
    x5,y5 = apex3(x3,y3,x4,y4)

    koch(x1,y1,x3,y3,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x3,y3))
    koch(x3,y3,x5,y5,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x5,y5))
    koch(x5,y5,x4,y4,l+1,lmax)
    print('{:.10f} {:.10f}'.format(x4,y4))
    koch(x4,y4,x2,y2,l+1,lmax)

    return

def main(n):
    x0=0;y0=0
    x1=100;y1=0
    print('{:.10f} {:.10f}'.format(x0,y0))
    koch(x0,y0,x1,y1,0,n)
    print('{:.10f} {:.10f}'.format(x1,y1))


if __name__=='__main__':
    n=readinput()
    main(n)

