from math import cos, sin, pi


class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def show(self):
        print(f"{self.x:.8f} {self.y:.8f}")


def calc_s(p1, p2) -> Point:
    x = p1.x * 2 / 3 + p2.x / 3
    y = p1.y * 2 / 3 + p2.y / 3
    s = Point(x, y)
    return s


def calc_t(p1, p2) -> Point:
    x = p1.x / 3 + p2.x * 2 / 3
    y = p1.y / 3 + p2.y * 2 / 3
    t = Point(x, y)
    return t


def calc_u(s, t) -> Point:
    theta = pi / 3
    x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta)
    y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta)
    u = Point(x, y)
    return u


def koch(n, p1, p2):
    if n == 0:
        return

    s = calc_s(p1, p2)
    t = calc_t(p1, p2)
    u = calc_u(s, t)

    koch(n - 1, p1, s)
    s.show()

    koch(n - 1, s, u)
    u.show()

    koch(n - 1, u, t)
    t.show()

    koch(n - 1, t, p2)


def main():
    n = int(input())
    p1 = Point(0, 0)
    p2 = Point(100, 0)

    p1.show()
    koch(n, p1, p2)
    p2.show()


if __name__ == "__main__":
    main()
 from math import cos, sin, pi class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def show(self):
        print(f"{self.x:.8f} {self.y:.8f}") Point def __init__(self, x, y):
        self.x = x
        self.y = y

     __init__ self.x = x self.x self x x self.y = y self.y self y y self self x x y y def show(self):
        print(f"{self.x:.8f} {self.y:.8f}") show print(f"{self.x:.8f} {self.y:.8f}") print f"{self.x:.8f} {self.y:.8f}" self self def calc_s(p1, p2) -> Point:
    x = p1.x * 2 / 3 + p2.x / 3
    y = p1.y * 2 / 3 + p2.y / 3
    s = Point(x, y)
    return s calc_s x = p1.x * 2 / 3 + p2.x / 3 x p1.x * 2 / 3 + p2.x / 3 p1.x * 2 / 3 p1.x * 2 p1.x p1 x 2 3 p2.x / 3 p2.x p2 x 3 y = p1.y * 2 / 3 + p2.y / 3 y p1.y * 2 / 3 + p2.y / 3 p1.y * 2 / 3 p1.y * 2 p1.y p1 y 2 3 p2.y / 3 p2.y p2 y 3 s = Point(x, y) s Point(x, y) Point x y return s s p1 p1 p2 p2 def calc_t(p1, p2) -> Point:
    x = p1.x / 3 + p2.x * 2 / 3
    y = p1.y / 3 + p2.y * 2 / 3
    t = Point(x, y)
    return t calc_t x = p1.x / 3 + p2.x * 2 / 3 x p1.x / 3 + p2.x * 2 / 3 p1.x / 3 p1.x p1 x 3 p2.x * 2 / 3 p2.x * 2 p2.x p2 x 2 3 y = p1.y / 3 + p2.y * 2 / 3 y p1.y / 3 + p2.y * 2 / 3 p1.y / 3 p1.y p1 y 3 p2.y * 2 / 3 p2.y * 2 p2.y p2 y 2 3 t = Point(x, y) t Point(x, y) Point x y return t t p1 p1 p2 p2 def calc_u(s, t) -> Point:
    theta = pi / 3
    x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta)
    y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta)
    u = Point(x, y)
    return u calc_u theta = pi / 3 theta pi / 3 pi 3 x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta) x s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta) s.x + (t.x - s.x) * cos(theta) s.x s x (t.x - s.x) * cos(theta) t.x - s.x t.x t x s.x s x cos(theta) cos theta (t.y - s.y) * sin(theta) t.y - s.y t.y t y s.y s y sin(theta) sin theta y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta) y s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta) s.y + (t.x - s.x) * sin(theta) s.y s y (t.x - s.x) * sin(theta) t.x - s.x t.x t x s.x s x sin(theta) sin theta (t.y - s.y) * cos(theta) t.y - s.y t.y t y s.y s y cos(theta) cos theta u = Point(x, y) u Point(x, y) Point x y return u u s s t t def koch(n, p1, p2):
    if n == 0:
        return

    s = calc_s(p1, p2)
    t = calc_t(p1, p2)
    u = calc_u(s, t)

    koch(n - 1, p1, s)
    s.show()

    koch(n - 1, s, u)
    u.show()

    koch(n - 1, u, t)
    t.show()

    koch(n - 1, t, p2) koch if n == 0:
        return

     n == 0 n 0 return s = calc_s(p1, p2) s calc_s(p1, p2) calc_s p1 p2 t = calc_t(p1, p2) t calc_t(p1, p2) calc_t p1 p2 u = calc_u(s, t) u calc_u(s, t) calc_u s t koch(n - 1, p1, s) koch n - 1 n 1 p1 s s.show() s.show s show koch(n - 1, s, u) koch n - 1 n 1 s u u.show() u.show u show koch(n - 1, u, t) koch n - 1 n 1 u t t.show() t.show t show koch(n - 1, t, p2) koch n - 1 n 1 t p2 n n p1 p1 p2 p2 def main():
    n = int(input())
    p1 = Point(0, 0)
    p2 = Point(100, 0)

    p1.show()
    koch(n, p1, p2)
    p2.show() main n = int(input()) n int(input()) int input() input p1 = Point(0, 0) p1 Point(0, 0) Point 0 0 p2 = Point(100, 0) p2 Point(100, 0) Point 100 0 p1.show() p1.show p1 show koch(n, p1, p2) koch n p1 p2 p2.show() p2.show p2 show if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def calc_s(p1, p2) -> Point:
    x = p1.x * 2 / 3 + p2.x / 3
    y = p1.y * 2 / 3 + p2.y / 3
    s = Point(x, y)
    return s def calc_s(p1, p2) -> Point:
    x = p1.x * 2 / 3 + p2.x / 3
    y = p1.y * 2 / 3 + p2.y / 3
    s = Point(x, y)
    return s calc_s def koch(n, p1, p2):
    if n == 0:
        return

    s = calc_s(p1, p2)
    t = calc_t(p1, p2)
    u = calc_u(s, t)

    koch(n - 1, p1, s)
    s.show()

    koch(n - 1, s, u)
    u.show()

    koch(n - 1, u, t)
    t.show()

    koch(n - 1, t, p2) def koch(n, p1, p2):
    if n == 0:
        return

    s = calc_s(p1, p2)
    t = calc_t(p1, p2)
    u = calc_u(s, t)

    koch(n - 1, p1, s)
    s.show()

    koch(n - 1, s, u)
    u.show()

    koch(n - 1, u, t)
    t.show()

    koch(n - 1, t, p2) koch def calc_t(p1, p2) -> Point:
    x = p1.x / 3 + p2.x * 2 / 3
    y = p1.y / 3 + p2.y * 2 / 3
    t = Point(x, y)
    return t def calc_t(p1, p2) -> Point:
    x = p1.x / 3 + p2.x * 2 / 3
    y = p1.y / 3 + p2.y * 2 / 3
    t = Point(x, y)
    return t calc_t class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def show(self):
        print(f"{self.x:.8f} {self.y:.8f}") class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def show(self):
        print(f"{self.x:.8f} {self.y:.8f}") Point def calc_u(s, t) -> Point:
    theta = pi / 3
    x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta)
    y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta)
    u = Point(x, y)
    return u def calc_u(s, t) -> Point:
    theta = pi / 3
    x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta)
    y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta)
    u = Point(x, y)
    return u calc_u def main():
    n = int(input())
    p1 = Point(0, 0)
    p2 = Point(100, 0)

    p1.show()
    koch(n, p1, p2)
    p2.show() def main():
    n = int(input())
    p1 = Point(0, 0)
    p2 = Point(100, 0)

    p1.show()
    koch(n, p1, p2)
    p2.show() main
from math import cos, sin, pi


class Point():
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def show(self):
        print(f"{self.x:.8f} {self.y:.8f}")


def calc_s(p1, p2) -> Point:
    x = p1.x * 2 / 3 + p2.x / 3
    y = p1.y * 2 / 3 + p2.y / 3
    s = Point(x, y)
    return s


def calc_t(p1, p2) -> Point:
    x = p1.x / 3 + p2.x * 2 / 3
    y = p1.y / 3 + p2.y * 2 / 3
    t = Point(x, y)
    return t


def calc_u(s, t) -> Point:
    theta = pi / 3
    x = s.x + (t.x - s.x) * cos(theta) - (t.y - s.y) * sin(theta)
    y = s.y + (t.x - s.x) * sin(theta) + (t.y - s.y) * cos(theta)
    u = Point(x, y)
    return u


def koch(n, p1, p2):
    if n == 0:
        return

    s = calc_s(p1, p2)
    t = calc_t(p1, p2)
    u = calc_u(s, t)

    koch(n - 1, p1, s)
    s.show()

    koch(n - 1, s, u)
    u.show()

    koch(n - 1, u, t)
    t.show()

    koch(n - 1, t, p2)


def main():
    n = int(input())
    p1 = Point(0, 0)
    p2 = Point(100, 0)

    p1.show()
    koch(n, p1, p2)
    p2.show()


if __name__ == "__main__":
    main()

