# コッホ曲線 Koch curve

import math

class Point():

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

    def __repr__(self):
        return str(self.x) + " " + str(self.y)


def Koch(p1, p2, n):
    if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1)


r3 = math.sqrt(3)
start = Point(0, 0)
goal = Point(100, 0)
n = int(input())
Koch(start, goal, n)
print(goal)
 import math math class Point():

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

    def __repr__(self):
        return str(self.x) + " " + str(self.y) 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 __repr__(self):
        return str(self.x) + " " + str(self.y) __repr__ return str(self.x) + " " + str(self.y) str(self.x) + " " + str(self.y) str(self.x) + " " str(self.x) str self.x self x " " str(self.y) str self.y self y self self def Koch(p1, p2, n):
    if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1) Koch if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1) n == 0 n 0 print(p1) print p1 s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3) s Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3) Point p1.x * 2 / 3 + p2.x * 1 / 3 p1.x * 2 / 3 p1.x * 2 p1.x p1 x 2 3 p2.x * 1 / 3 p2.x * 1 p2.x p2 x 1 3 p1.y * 2 / 3 + p2.y * 1 / 3 p1.y * 2 / 3 p1.y * 2 p1.y p1 y 2 3 p2.y * 1 / 3 p2.y * 1 p2.y p2 y 1 3 u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6) u Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6) Point p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6 p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 p1.x / 2 + p2.x / 2 p1.x / 2 p1.x p1 x 2 p2.x / 2 p2.x p2 x 2 p1.y * r3 / 6 p1.y * r3 p1.y p1 y r3 6 p2.y * r3 / 6 p2.y * r3 p2.y p2 y r3 6 p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6 p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 p1.y / 2 + p2.y / 2 p1.y / 2 p1.y p1 y 2 p2.y / 2 p2.y p2 y 2 p2.x * r3 / 6 p2.x * r3 p2.x p2 x r3 6 p1.x * r3 / 6 p1.x * r3 p1.x p1 x r3 6 t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3) t Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3) Point p1.x * 1 / 3 + p2.x * 2 / 3 p1.x * 1 / 3 p1.x * 1 p1.x p1 x 1 3 p2.x * 2 / 3 p2.x * 2 p2.x p2 x 2 3 p1.y * 1 / 3 + p2.y * 2 / 3 p1.y * 1 / 3 p1.y * 1 p1.y p1 y 1 3 p2.y * 2 / 3 p2.y * 2 p2.y p2 y 2 3 Koch(p1, s, n - 1) Koch p1 s n - 1 n 1 Koch(s, u, n - 1) Koch s u n - 1 n 1 Koch(u, t, n - 1) Koch u t n - 1 n 1 Koch(t, p2, n - 1) Koch t p2 n - 1 n 1 p1 p1 p2 p2 n n r3 = math.sqrt(3) r3 math.sqrt(3) math.sqrt math sqrt 3 start = Point(0, 0) start Point(0, 0) Point 0 0 goal = Point(100, 0) goal Point(100, 0) Point 100 0 n = int(input()) n int(input()) int input() input Koch(start, goal, n) Koch start goal n print(goal) print goal r3 = math.sqrt(3) math.sqrt(3) r3 goal = Point(100, 0) Point(100, 0) goal n = int(input()) int(input()) n class Point():

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

    def __repr__(self):
        return str(self.x) + " " + str(self.y) class Point():

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

    def __repr__(self):
        return str(self.x) + " " + str(self.y) Point def Koch(p1, p2, n):
    if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1) def Koch(p1, p2, n):
    if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1) Koch start = Point(0, 0) Point(0, 0) start
# コッホ曲線 Koch curve

import math

class Point():

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

    def __repr__(self):
        return str(self.x) + " " + str(self.y)


def Koch(p1, p2, n):
    if n == 0:
        print(p1)
    else:
        s = Point(p1.x * 2 / 3 + p2.x * 1 / 3, p1.y * 2 / 3 + p2.y * 1 / 3)
        u = Point(p1.x / 2 + p2.x / 2 + p1.y * r3 / 6 - p2.y * r3 / 6, p1.y / 2 + p2.y / 2 + p2.x * r3 / 6 - p1.x * r3 / 6)
        t = Point(p1.x * 1 / 3 + p2.x * 2 / 3, p1.y * 1 / 3 + p2.y * 2 / 3)
        Koch(p1, s, n - 1)
        Koch(s, u, n - 1)
        Koch(u, t, n - 1)
        Koch(t, p2, n - 1)


r3 = math.sqrt(3)
start = Point(0, 0)
goal = Point(100, 0)
n = int(input())
Koch(start, goal, n)
print(goal)

