# encoding: utf-8


import sys
import math

_input = sys.stdin.readlines()
depth = int(_input[0])
sin_60, cos_60 = math.sin(math.pi / 3), math.cos(math.pi / 3)


class Point(object):
    def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y)


def koch_curve(d, p1, p2):
    if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
    s = Point()
    t = Point()
    u = Point()
    s.x = (2 * p1.x + p2.x) / 3
    s.y = (2 * p1.y + p2.y) / 3

    t.x = (p1.x + 2 * p2.x) / 3
    t.y = (p1.y + 2 * p2.y) / 3

    u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x
    u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y

    koch_curve(d - 1, p1, s)
    print(format(s.x, '.8f'), format(s.y, '.8f'))

    koch_curve(d - 1, s, u)
    print(format(u.x, '.8f'), format(u.y, '.8f'))

    koch_curve(d - 1, u, t)
    print(format(t.x, '.8f'), format(t.y, '.8f'))

    koch_curve(d - 1, t, p2)


if __name__ == '__main__':
    p1_start, p2_end = Point(x=0, y=0), Point(x=100, y=0)
    print(format(p1_start.x, '.8f'), '', format(p1_start.y, '.8f'))
    koch_curve(depth, p1_start, p2_end)
    print(format(p2_end.x, '.8f'), '', format(p2_end.y, '.8f')) import sys sys import math math _input = sys.stdin.readlines() _input sys.stdin.readlines() sys.stdin.readlines sys.stdin sys stdin readlines depth = int(_input[0]) depth int(_input[0]) int _input[0] _input 0 sin_60, cos_60 = math.sin(math.pi / 3), math.cos(math.pi / 3) sin_60 math.sin(math.pi / 3) math.sin math sin math.pi / 3 math.pi math pi 3 cos_60 math.cos(math.pi / 3) math.cos math cos math.pi / 3 math.pi math pi 3 class Point(object):
    def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y) Point def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y) __init__ """
        initialize the point
        """ self.x = float(x) self.x self x float(x) float x self.y = float(y) self.y self y float(y) float y self self x=0.0 x 0.0 y=0.0 y 0.0 object def koch_curve(d, p1, p2):
    if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
    s = Point()
    t = Point()
    u = Point()
    s.x = (2 * p1.x + p2.x) / 3
    s.y = (2 * p1.y + p2.y) / 3

    t.x = (p1.x + 2 * p2.x) / 3
    t.y = (p1.y + 2 * p2.y) / 3

    u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x
    u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y

    koch_curve(d - 1, p1, s)
    print(format(s.x, '.8f'), format(s.y, '.8f'))

    koch_curve(d - 1, s, u)
    print(format(u.x, '.8f'), format(u.y, '.8f'))

    koch_curve(d - 1, u, t)
    print(format(t.x, '.8f'), format(t.y, '.8f'))

    koch_curve(d - 1, t, p2) koch_curve if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
     not d d return None None s = Point() s Point() Point t = Point() t Point() Point u = Point() u Point() Point s.x = (2 * p1.x + p2.x) / 3 s.x s x (2 * p1.x + p2.x) / 3 2 * p1.x + p2.x 2 * p1.x 2 p1.x p1 x p2.x p2 x 3 s.y = (2 * p1.y + p2.y) / 3 s.y s y (2 * p1.y + p2.y) / 3 2 * p1.y + p2.y 2 * p1.y 2 p1.y p1 y p2.y p2 y 3 t.x = (p1.x + 2 * p2.x) / 3 t.x t x (p1.x + 2 * p2.x) / 3 p1.x + 2 * p2.x p1.x p1 x 2 * p2.x 2 p2.x p2 x 3 t.y = (p1.y + 2 * p2.y) / 3 t.y t y (p1.y + 2 * p2.y) / 3 p1.y + 2 * p2.y p1.y p1 y 2 * p2.y 2 p2.y p2 y 3 u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x u.x u x (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 (t.x - s.x) * cos_60 t.x - s.x t.x t x s.x s x cos_60 (t.y - s.y) * sin_60 t.y - s.y t.y t y s.y s y sin_60 s.x s x u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y u.y u y (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 (t.x - s.x) * sin_60 t.x - s.x t.x t x s.x s x sin_60 (t.y - s.y) * cos_60 t.y - s.y t.y t y s.y s y cos_60 s.y s y koch_curve(d - 1, p1, s) koch_curve d - 1 d 1 p1 s print(format(s.x, '.8f'), format(s.y, '.8f')) print format(s.x, '.8f') format s.x s x '.8f' format(s.y, '.8f') format s.y s y '.8f' koch_curve(d - 1, s, u) koch_curve d - 1 d 1 s u print(format(u.x, '.8f'), format(u.y, '.8f')) print format(u.x, '.8f') format u.x u x '.8f' format(u.y, '.8f') format u.y u y '.8f' koch_curve(d - 1, u, t) koch_curve d - 1 d 1 u t print(format(t.x, '.8f'), format(t.y, '.8f')) print format(t.x, '.8f') format t.x t x '.8f' format(t.y, '.8f') format t.y t y '.8f' koch_curve(d - 1, t, p2) koch_curve d - 1 d 1 t p2 d d p1 p1 p2 p2 if __name__ == '__main__':
    p1_start, p2_end = Point(x=0, y=0), Point(x=100, y=0)
    print(format(p1_start.x, '.8f'), '', format(p1_start.y, '.8f'))
    koch_curve(depth, p1_start, p2_end)
    print(format(p2_end.x, '.8f'), '', format(p2_end.y, '.8f')) __name__ == '__main__' __name__ '__main__' p1_start, p2_end = Point(x=0, y=0), Point(x=100, y=0) p1_start Point(x=0, y=0) Point x=0 x 0 y=0 y 0 p2_end Point(x=100, y=0) Point x=100 x 100 y=0 y 0 print(format(p1_start.x, '.8f'), '', format(p1_start.y, '.8f')) print format(p1_start.x, '.8f') format p1_start.x p1_start x '.8f' '' format(p1_start.y, '.8f') format p1_start.y p1_start y '.8f' koch_curve(depth, p1_start, p2_end) koch_curve depth p1_start p2_end print(format(p2_end.x, '.8f'), '', format(p2_end.y, '.8f')) print format(p2_end.x, '.8f') format p2_end.x p2_end x '.8f' '' format(p2_end.y, '.8f') format p2_end.y p2_end y '.8f' p1_start, p2_end = Point(x=0, y=0), Point(x=100, y=0) Point(x=0, y=0) p1_start p2_end = Point(x=0, y=0), Point(x=100, y=0) Point(x=100, y=0) p2_end depth = int(_input[0]) int(_input[0]) depth cos_60 = math.sin(math.pi / 3), math.cos(math.pi / 3) math.cos(math.pi / 3) cos_60 class Point(object):
    def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y) class Point(object):
    def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y) Point sin_60, cos_60 = math.sin(math.pi / 3), math.cos(math.pi / 3) math.sin(math.pi / 3) sin_60 def koch_curve(d, p1, p2):
    if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
    s = Point()
    t = Point()
    u = Point()
    s.x = (2 * p1.x + p2.x) / 3
    s.y = (2 * p1.y + p2.y) / 3

    t.x = (p1.x + 2 * p2.x) / 3
    t.y = (p1.y + 2 * p2.y) / 3

    u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x
    u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y

    koch_curve(d - 1, p1, s)
    print(format(s.x, '.8f'), format(s.y, '.8f'))

    koch_curve(d - 1, s, u)
    print(format(u.x, '.8f'), format(u.y, '.8f'))

    koch_curve(d - 1, u, t)
    print(format(t.x, '.8f'), format(t.y, '.8f'))

    koch_curve(d - 1, t, p2) def koch_curve(d, p1, p2):
    if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
    s = Point()
    t = Point()
    u = Point()
    s.x = (2 * p1.x + p2.x) / 3
    s.y = (2 * p1.y + p2.y) / 3

    t.x = (p1.x + 2 * p2.x) / 3
    t.y = (p1.y + 2 * p2.y) / 3

    u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x
    u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y

    koch_curve(d - 1, p1, s)
    print(format(s.x, '.8f'), format(s.y, '.8f'))

    koch_curve(d - 1, s, u)
    print(format(u.x, '.8f'), format(u.y, '.8f'))

    koch_curve(d - 1, u, t)
    print(format(t.x, '.8f'), format(t.y, '.8f'))

    koch_curve(d - 1, t, p2) koch_curve _input = sys.stdin.readlines() sys.stdin.readlines() _input
# encoding: utf-8


import sys
import math

_input = sys.stdin.readlines()
depth = int(_input[0])
sin_60, cos_60 = math.sin(math.pi / 3), math.cos(math.pi / 3)


class Point(object):
    def __init__(self, x=0.0, y=0.0):
        """
        initialize the point
        """
        self.x = float(x)
        self.y = float(y)


def koch_curve(d, p1, p2):
    if not d:
        # print('end')
        return None

    # s, t, u = Point(), Point, Point()
    s = Point()
    t = Point()
    u = Point()
    s.x = (2 * p1.x + p2.x) / 3
    s.y = (2 * p1.y + p2.y) / 3

    t.x = (p1.x + 2 * p2.x) / 3
    t.y = (p1.y + 2 * p2.y) / 3

    u.x = (t.x - s.x) * cos_60 - (t.y - s.y) * sin_60 + s.x
    u.y = (t.x - s.x) * sin_60 + (t.y - s.y) * cos_60 + s.y

    koch_curve(d - 1, p1, s)
    print(format(s.x, '.8f'), format(s.y, '.8f'))

    koch_curve(d - 1, s, u)
    print(format(u.x, '.8f'), format(u.y, '.8f'))

    koch_curve(d - 1, u, t)
    print(format(t.x, '.8f'), format(t.y, '.8f'))

    koch_curve(d - 1, t, p2)


if __name__ == '__main__':
    p1_start, p2_end = Point(x=0, y=0), Point(x=100, y=0)
    print(format(p1_start.x, '.8f'), '', format(p1_start.y, '.8f'))
    koch_curve(depth, p1_start, p2_end)
    print(format(p2_end.x, '.8f'), '', format(p2_end.y, '.8f'))