#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_C&lang=jp
import math
def get_koch_curve_points(curve_num, points):

    result = points
    for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
    return result

def koch_curve(left_points, right_points):
    len_x = right_points[0] - left_points[0]
    len_y = right_points[1] - left_points[1]

    distance_x = len_x / 3
    distance_y = len_y / 3

    s = (left_points[0] + distance_x, left_points[1] + distance_y)
    t = (right_points[0] - distance_x, right_points[1] - distance_y)

    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60)
    return [s, u, t]

if __name__ == "__main__":

    curve_num = int(input())
    res = get_koch_curve_points(curve_num, [(0,0),(100,0)])
    print("\n".join([str(x) + " " + str(y) for x,y in res])) import math math def get_koch_curve_points(curve_num, points):

    result = points
    for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
    return result get_koch_curve_points result = points result points for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
     i range(curve_num) range curve_num next_list = [] next_list [] for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
         j range(len(result) - 1) range len(result) - 1 len(result) len result 1 next_list.append(result[j]) next_list.append next_list append result[j] result j next_list.extend(koch_curve(result[j], result[j + 1])) next_list.extend next_list extend koch_curve(result[j], result[j + 1]) koch_curve result[j] result j result[j + 1] result j + 1 j 1 next_list.append(result[-1]) next_list.append next_list append result[-1] result -1 result = next_list result next_list return result result curve_num curve_num points points def koch_curve(left_points, right_points):
    len_x = right_points[0] - left_points[0]
    len_y = right_points[1] - left_points[1]

    distance_x = len_x / 3
    distance_y = len_y / 3

    s = (left_points[0] + distance_x, left_points[1] + distance_y)
    t = (right_points[0] - distance_x, right_points[1] - distance_y)

    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60)
    return [s, u, t] koch_curve len_x = right_points[0] - left_points[0] len_x right_points[0] - left_points[0] right_points[0] right_points 0 left_points[0] left_points 0 len_y = right_points[1] - left_points[1] len_y right_points[1] - left_points[1] right_points[1] right_points 1 left_points[1] left_points 1 distance_x = len_x / 3 distance_x len_x / 3 len_x 3 distance_y = len_y / 3 distance_y len_y / 3 len_y 3 s = (left_points[0] + distance_x, left_points[1] + distance_y) s (left_points[0] + distance_x, left_points[1] + distance_y) left_points[0] + distance_x left_points[0] left_points 0 distance_x left_points[1] + distance_y left_points[1] left_points 1 distance_y t = (right_points[0] - distance_x, right_points[1] - distance_y) t (right_points[0] - distance_x, right_points[1] - distance_y) right_points[0] - distance_x right_points[0] right_points 0 distance_x right_points[1] - distance_y right_points[1] right_points 1 distance_y cos60 = math.cos(math.radians(60)) cos60 math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 sin60 = math.sin(math.radians(60)) sin60 math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60) u (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60) s[0] + distance_x * cos60 - distance_y * sin60 s[0] + distance_x * cos60 s[0] s 0 distance_x * cos60 distance_x cos60 distance_y * sin60 distance_y sin60 s[1] + distance_x * sin60 + distance_y * cos60 s[1] + distance_x * sin60 s[1] s 1 distance_x * sin60 distance_x sin60 distance_y * cos60 distance_y cos60 return [s, u, t] [s, u, t] s u t left_points left_points right_points right_points if __name__ == "__main__":

    curve_num = int(input())
    res = get_koch_curve_points(curve_num, [(0,0),(100,0)])
    print("\n".join([str(x) + " " + str(y) for x,y in res])) __name__ == "__main__" __name__ "__main__" curve_num = int(input()) curve_num int(input()) int input() input res = get_koch_curve_points(curve_num, [(0,0),(100,0)]) res get_koch_curve_points(curve_num, [(0,0),(100,0)]) get_koch_curve_points curve_num [(0,0),(100,0)] (0,0) 0 0 (100,0) 100 0 str(x) + " " + str(y) for x,y in res for x,y in res x y res for x,y in res str(x) + " " + str(y) str(x) + " " str(x) str x " " str(y) str y print("\n".join([str(x) + " " + str(y) for x,y in res])) print "\n".join([str(x) + " " + str(y) for x,y in res]) "\n".join "\n" join [str(x) + " " + str(y) for x,y in res] def get_koch_curve_points(curve_num, points):

    result = points
    for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
    return result def get_koch_curve_points(curve_num, points):

    result = points
    for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
    return result get_koch_curve_points res = get_koch_curve_points(curve_num, [(0,0),(100,0)]) get_koch_curve_points(curve_num, [(0,0),(100,0)]) res curve_num = int(input()) int(input()) curve_num def koch_curve(left_points, right_points):
    len_x = right_points[0] - left_points[0]
    len_y = right_points[1] - left_points[1]

    distance_x = len_x / 3
    distance_y = len_y / 3

    s = (left_points[0] + distance_x, left_points[1] + distance_y)
    t = (right_points[0] - distance_x, right_points[1] - distance_y)

    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60)
    return [s, u, t] def koch_curve(left_points, right_points):
    len_x = right_points[0] - left_points[0]
    len_y = right_points[1] - left_points[1]

    distance_x = len_x / 3
    distance_y = len_y / 3

    s = (left_points[0] + distance_x, left_points[1] + distance_y)
    t = (right_points[0] - distance_x, right_points[1] - distance_y)

    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60)
    return [s, u, t] koch_curve
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_C&lang=jp
import math
def get_koch_curve_points(curve_num, points):

    result = points
    for i in range(curve_num):
        next_list = []
        for j in range(len(result) - 1):
            next_list.append(result[j])
            next_list.extend(koch_curve(result[j], result[j + 1]))
        next_list.append(result[-1])
        result = next_list
        
    return result

def koch_curve(left_points, right_points):
    len_x = right_points[0] - left_points[0]
    len_y = right_points[1] - left_points[1]

    distance_x = len_x / 3
    distance_y = len_y / 3

    s = (left_points[0] + distance_x, left_points[1] + distance_y)
    t = (right_points[0] - distance_x, right_points[1] - distance_y)

    cos60 = math.cos(math.radians(60))
    sin60 = math.sin(math.radians(60))
    u = (s[0] + distance_x * cos60 - distance_y * sin60, s[1] + distance_x * sin60 + distance_y * cos60)
    return [s, u, t]

if __name__ == "__main__":

    curve_num = int(input())
    res = get_koch_curve_points(curve_num, [(0,0),(100,0)])
    print("\n".join([str(x) + " " + str(y) for x,y in res]))