# coding=utf-8
import math


def cut_into_three(start: list, end: list) -> list:
    x1 = (2*start[0]+end[0])/3
    y1 = (2*start[1]+end[1])/3
    mid_point1 = [x1, y1]

    x2 = (start[0]+2*end[0])/3
    y2 = (start[1]+2*end[1])/3
    mid_point2 = [x2, y2]

    points_list = [start, mid_point1, mid_point2, end]
    return points_list


def equil_triangle(point1: list, point2: list) -> list:
    cos60 = math.cos(math.pi / 3)
    sin60 = math.sin(math.pi / 3)

    x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0]
    y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1]

    return [x, y]


def make_projection(start: list, end: list) -> list:
    points_list = cut_into_three(start, end)
    projection_point = equil_triangle(points_list[1], points_list[2])
    points_list.insert(2, projection_point)
    return points_list


def koch_curve(start: list, end: list, number: int) -> list:
    if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list


if __name__ == '__main__':
    n = int(input())
    p1 = [0, 0]
    p2 = [100, 0]
    fractal_points = koch_curve(p1, p2, n)
    for i in fractal_points:
        print(' '.join(map(str, i))) import math math def cut_into_three(start: list, end: list) -> list:
    x1 = (2*start[0]+end[0])/3
    y1 = (2*start[1]+end[1])/3
    mid_point1 = [x1, y1]

    x2 = (start[0]+2*end[0])/3
    y2 = (start[1]+2*end[1])/3
    mid_point2 = [x2, y2]

    points_list = [start, mid_point1, mid_point2, end]
    return points_list cut_into_three x1 = (2*start[0]+end[0])/3 x1 (2*start[0]+end[0])/3 2*start[0]+end[0] 2*start[0] 2 start[0] start 0 end[0] end 0 3 y1 = (2*start[1]+end[1])/3 y1 (2*start[1]+end[1])/3 2*start[1]+end[1] 2*start[1] 2 start[1] start 1 end[1] end 1 3 mid_point1 = [x1, y1] mid_point1 [x1, y1] x1 y1 x2 = (start[0]+2*end[0])/3 x2 (start[0]+2*end[0])/3 start[0]+2*end[0] start[0] start 0 2*end[0] 2 end[0] end 0 3 y2 = (start[1]+2*end[1])/3 y2 (start[1]+2*end[1])/3 start[1]+2*end[1] start[1] start 1 2*end[1] 2 end[1] end 1 3 mid_point2 = [x2, y2] mid_point2 [x2, y2] x2 y2 points_list = [start, mid_point1, mid_point2, end] points_list [start, mid_point1, mid_point2, end] start mid_point1 mid_point2 end return points_list points_list start: list start end: list end def equil_triangle(point1: list, point2: list) -> list:
    cos60 = math.cos(math.pi / 3)
    sin60 = math.sin(math.pi / 3)

    x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0]
    y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1]

    return [x, y] equil_triangle cos60 = math.cos(math.pi / 3) cos60 math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 sin60 = math.sin(math.pi / 3) sin60 math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0] x (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0] (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 (point2[0] - point1[0])*cos60 point2[0] - point1[0] point2[0] point2 0 point1[0] point1 0 cos60 (point2[1]-point1[1])*sin60 point2[1]-point1[1] point2[1] point2 1 point1[1] point1 1 sin60 point1[0] point1 0 y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1] y (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1] (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 (point2[0] - point1[0])*sin60 point2[0] - point1[0] point2[0] point2 0 point1[0] point1 0 sin60 (point2[1]-point1[1])*cos60 point2[1]-point1[1] point2[1] point2 1 point1[1] point1 1 cos60 point1[1] point1 1 return [x, y] [x, y] x y point1: list point1 point2: list point2 def make_projection(start: list, end: list) -> list:
    points_list = cut_into_three(start, end)
    projection_point = equil_triangle(points_list[1], points_list[2])
    points_list.insert(2, projection_point)
    return points_list make_projection points_list = cut_into_three(start, end) points_list cut_into_three(start, end) cut_into_three start end projection_point = equil_triangle(points_list[1], points_list[2]) projection_point equil_triangle(points_list[1], points_list[2]) equil_triangle points_list[1] points_list 1 points_list[2] points_list 2 points_list.insert(2, projection_point) points_list.insert points_list insert 2 projection_point return points_list points_list start: list start end: list end def koch_curve(start: list, end: list, number: int) -> list:
    if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list koch_curve if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list number == 0 number 0 return [start, end] [start, end] start end points_list = make_projection(start, end) points_list make_projection(start, end) make_projection start end list1 = koch_curve(points_list[0], points_list[1], number-1) list1 koch_curve(points_list[0], points_list[1], number-1) koch_curve points_list[0] points_list 0 points_list[1] points_list 1 number-1 number 1 list2 = koch_curve(points_list[1], points_list[2], number-1) list2 koch_curve(points_list[1], points_list[2], number-1) koch_curve points_list[1] points_list 1 points_list[2] points_list 2 number-1 number 1 list3 = koch_curve(points_list[2], points_list[3], number-1) list3 koch_curve(points_list[2], points_list[3], number-1) koch_curve points_list[2] points_list 2 points_list[3] points_list 3 number-1 number 1 list4 = koch_curve(points_list[3], points_list[4], number-1) list4 koch_curve(points_list[3], points_list[4], number-1) koch_curve points_list[3] points_list 3 points_list[4] points_list 4 number-1 number 1 new_points_list = list1 + list2[1:] + list3[1:] + list4[1:] new_points_list list1 + list2[1:] + list3[1:] + list4[1:] list1 + list2[1:] + list3[1:] list1 + list2[1:] list1 list2[1:] list2 1: 1 list3[1:] list3 1: 1 list4[1:] list4 1: 1 return new_points_list new_points_list start: list start end: list end number: int number if __name__ == '__main__':
    n = int(input())
    p1 = [0, 0]
    p2 = [100, 0]
    fractal_points = koch_curve(p1, p2, n)
    for i in fractal_points:
        print(' '.join(map(str, i))) __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input p1 = [0, 0] p1 [0, 0] 0 0 p2 = [100, 0] p2 [100, 0] 100 0 fractal_points = koch_curve(p1, p2, n) fractal_points koch_curve(p1, p2, n) koch_curve p1 p2 n for i in fractal_points:
        print(' '.join(map(str, i))) i fractal_points print(' '.join(map(str, i))) print ' '.join(map(str, i)) ' '.join ' ' join map(str, i) map str i def koch_curve(start: list, end: list, number: int) -> list:
    if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list def koch_curve(start: list, end: list, number: int) -> list:
    if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list koch_curve def cut_into_three(start: list, end: list) -> list:
    x1 = (2*start[0]+end[0])/3
    y1 = (2*start[1]+end[1])/3
    mid_point1 = [x1, y1]

    x2 = (start[0]+2*end[0])/3
    y2 = (start[1]+2*end[1])/3
    mid_point2 = [x2, y2]

    points_list = [start, mid_point1, mid_point2, end]
    return points_list def cut_into_three(start: list, end: list) -> list:
    x1 = (2*start[0]+end[0])/3
    y1 = (2*start[1]+end[1])/3
    mid_point1 = [x1, y1]

    x2 = (start[0]+2*end[0])/3
    y2 = (start[1]+2*end[1])/3
    mid_point2 = [x2, y2]

    points_list = [start, mid_point1, mid_point2, end]
    return points_list cut_into_three n = int(input()) int(input()) n p1 = [0, 0] [0, 0] p1 def equil_triangle(point1: list, point2: list) -> list:
    cos60 = math.cos(math.pi / 3)
    sin60 = math.sin(math.pi / 3)

    x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0]
    y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1]

    return [x, y] def equil_triangle(point1: list, point2: list) -> list:
    cos60 = math.cos(math.pi / 3)
    sin60 = math.sin(math.pi / 3)

    x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0]
    y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1]

    return [x, y] equil_triangle fractal_points = koch_curve(p1, p2, n) koch_curve(p1, p2, n) fractal_points p2 = [100, 0] [100, 0] p2 def make_projection(start: list, end: list) -> list:
    points_list = cut_into_three(start, end)
    projection_point = equil_triangle(points_list[1], points_list[2])
    points_list.insert(2, projection_point)
    return points_list def make_projection(start: list, end: list) -> list:
    points_list = cut_into_three(start, end)
    projection_point = equil_triangle(points_list[1], points_list[2])
    points_list.insert(2, projection_point)
    return points_list make_projection
# coding=utf-8
import math


def cut_into_three(start: list, end: list) -> list:
    x1 = (2*start[0]+end[0])/3
    y1 = (2*start[1]+end[1])/3
    mid_point1 = [x1, y1]

    x2 = (start[0]+2*end[0])/3
    y2 = (start[1]+2*end[1])/3
    mid_point2 = [x2, y2]

    points_list = [start, mid_point1, mid_point2, end]
    return points_list


def equil_triangle(point1: list, point2: list) -> list:
    cos60 = math.cos(math.pi / 3)
    sin60 = math.sin(math.pi / 3)

    x = (point2[0] - point1[0])*cos60 - (point2[1]-point1[1])*sin60 + point1[0]
    y = (point2[0] - point1[0])*sin60 + (point2[1]-point1[1])*cos60 + point1[1]

    return [x, y]


def make_projection(start: list, end: list) -> list:
    points_list = cut_into_three(start, end)
    projection_point = equil_triangle(points_list[1], points_list[2])
    points_list.insert(2, projection_point)
    return points_list


def koch_curve(start: list, end: list, number: int) -> list:
    if number == 0:
        return [start, end]
    else:
        points_list = make_projection(start, end)
        list1 = koch_curve(points_list[0], points_list[1], number-1)
        list2 = koch_curve(points_list[1], points_list[2], number-1)
        list3 = koch_curve(points_list[2], points_list[3], number-1)
        list4 = koch_curve(points_list[3], points_list[4], number-1)
        new_points_list = list1 + list2[1:] + list3[1:] + list4[1:]
        return new_points_list


if __name__ == '__main__':
    n = int(input())
    p1 = [0, 0]
    p2 = [100, 0]
    fractal_points = koch_curve(p1, p2, n)
    for i in fractal_points:
        print(' '.join(map(str, i)))