import math

n = int(input())

def dividing_point(p1, p2, ratio):
    return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio)

def rotate_vec_60deg(v):
    return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2)
    

def koch(depth, p_left, p_right):
    if depth == 0:
        return
    
    s = dividing_point(p_left, p_right, 1/3)
    t = dividing_point(p_left, p_right, 2/3)
    tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] ))
    u = (s[0] + tmpvec[0], s[1] + tmpvec[1])
    
    koch(depth - 1, p_left, s)
    print(s[0], s[1])
    koch(depth - 1, s, u)
    print(u[0], u[1])
    koch(depth - 1, u, t)
    print(t[0], t[1])
    koch(depth - 1, t, p_right)
    
    
print(0.0, 0.0)
koch(n, (0,0), (100, 0))
print(100.0, 0) import math math n = int(input()) n int(input()) int input() input def dividing_point(p1, p2, ratio):
    return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio) dividing_point return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio) ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio) p1[0]*(1-ratio) + p2[0]*ratio p1[0]*(1-ratio) p1[0] p1 0 1-ratio 1 ratio p2[0]*ratio p2[0] p2 0 ratio p1[1]*(1-ratio) + p2[1]*ratio p1[1]*(1-ratio) p1[1] p1 1 1-ratio 1 ratio p2[1]*ratio p2[1] p2 1 ratio p1 p1 p2 p2 ratio ratio def rotate_vec_60deg(v):
    return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2)
     rotate_vec_60deg return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2) (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2) v[0]/2 - math.sqrt(3)*v[1]/2 v[0]/2 v[0] v 0 2 math.sqrt(3)*v[1]/2 math.sqrt(3)*v[1] math.sqrt(3) math.sqrt math sqrt 3 v[1] v 1 2 math.sqrt(3)*v[0]/2 + v[1]/2 math.sqrt(3)*v[0]/2 math.sqrt(3)*v[0] math.sqrt(3) math.sqrt math sqrt 3 v[0] v 0 2 v[1]/2 v[1] v 1 2 v v def koch(depth, p_left, p_right):
    if depth == 0:
        return
    
    s = dividing_point(p_left, p_right, 1/3)
    t = dividing_point(p_left, p_right, 2/3)
    tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] ))
    u = (s[0] + tmpvec[0], s[1] + tmpvec[1])
    
    koch(depth - 1, p_left, s)
    print(s[0], s[1])
    koch(depth - 1, s, u)
    print(u[0], u[1])
    koch(depth - 1, u, t)
    print(t[0], t[1])
    koch(depth - 1, t, p_right)
    
     koch if depth == 0:
        return
    
     depth == 0 depth 0 return s = dividing_point(p_left, p_right, 1/3) s dividing_point(p_left, p_right, 1/3) dividing_point p_left p_right 1/3 1 3 t = dividing_point(p_left, p_right, 2/3) t dividing_point(p_left, p_right, 2/3) dividing_point p_left p_right 2/3 2 3 tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] )) tmpvec rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] )) rotate_vec_60deg (s[0] - p_left[0], s[1] - p_left[1] ) s[0] - p_left[0] s[0] s 0 p_left[0] p_left 0 s[1] - p_left[1] s[1] s 1 p_left[1] p_left 1 u = (s[0] + tmpvec[0], s[1] + tmpvec[1]) u (s[0] + tmpvec[0], s[1] + tmpvec[1]) s[0] + tmpvec[0] s[0] s 0 tmpvec[0] tmpvec 0 s[1] + tmpvec[1] s[1] s 1 tmpvec[1] tmpvec 1 koch(depth - 1, p_left, s) koch depth - 1 depth 1 p_left s print(s[0], s[1]) print s[0] s 0 s[1] s 1 koch(depth - 1, s, u) koch depth - 1 depth 1 s u print(u[0], u[1]) print u[0] u 0 u[1] u 1 koch(depth - 1, u, t) koch depth - 1 depth 1 u t print(t[0], t[1]) print t[0] t 0 t[1] t 1 koch(depth - 1, t, p_right) koch depth - 1 depth 1 t p_right depth depth p_left p_left p_right p_right print(0.0, 0.0) print 0.0 0.0 koch(n, (0,0), (100, 0)) koch n (0,0) 0 0 (100, 0) 100 0 print(100.0, 0) print 100.0 0 def dividing_point(p1, p2, ratio):
    return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio) def dividing_point(p1, p2, ratio):
    return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio) dividing_point def koch(depth, p_left, p_right):
    if depth == 0:
        return
    
    s = dividing_point(p_left, p_right, 1/3)
    t = dividing_point(p_left, p_right, 2/3)
    tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] ))
    u = (s[0] + tmpvec[0], s[1] + tmpvec[1])
    
    koch(depth - 1, p_left, s)
    print(s[0], s[1])
    koch(depth - 1, s, u)
    print(u[0], u[1])
    koch(depth - 1, u, t)
    print(t[0], t[1])
    koch(depth - 1, t, p_right)
    
     def koch(depth, p_left, p_right):
    if depth == 0:
        return
    
    s = dividing_point(p_left, p_right, 1/3)
    t = dividing_point(p_left, p_right, 2/3)
    tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] ))
    u = (s[0] + tmpvec[0], s[1] + tmpvec[1])
    
    koch(depth - 1, p_left, s)
    print(s[0], s[1])
    koch(depth - 1, s, u)
    print(u[0], u[1])
    koch(depth - 1, u, t)
    print(t[0], t[1])
    koch(depth - 1, t, p_right)
    
     koch n = int(input()) int(input()) n def rotate_vec_60deg(v):
    return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2)
     def rotate_vec_60deg(v):
    return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2)
     rotate_vec_60deg
import math

n = int(input())

def dividing_point(p1, p2, ratio):
    return ( p1[0]*(1-ratio) + p2[0]*ratio, p1[1]*(1-ratio) + p2[1]*ratio)

def rotate_vec_60deg(v):
    return (v[0]/2 - math.sqrt(3)*v[1]/2, math.sqrt(3)*v[0]/2 + v[1]/2)
    

def koch(depth, p_left, p_right):
    if depth == 0:
        return
    
    s = dividing_point(p_left, p_right, 1/3)
    t = dividing_point(p_left, p_right, 2/3)
    tmpvec = rotate_vec_60deg((s[0] - p_left[0], s[1] - p_left[1] ))
    u = (s[0] + tmpvec[0], s[1] + tmpvec[1])
    
    koch(depth - 1, p_left, s)
    print(s[0], s[1])
    koch(depth - 1, s, u)
    print(u[0], u[1])
    koch(depth - 1, u, t)
    print(t[0], t[1])
    koch(depth - 1, t, p_right)
    
    
print(0.0, 0.0)
koch(n, (0,0), (100, 0))
print(100.0, 0)
