import math


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


def koch(n, p1, p2):
    if n == 0:
        return
    s, t, u = [Point() for _ in range(3)]
    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
    a = math.radians(60)
    u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x
    u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y

    koch(n - 1, p1, s)
    print(s.x, s.y)
    koch(n - 1, s, u)
    print(u.x, u.y)
    koch(n - 1, u, t)
    print(t.x, t.y)
    koch(n - 1, t, p2)


p1 = Point(0, 0)
p2 = Point(100, 0)
n = int(input())
print(p1.x, p1.y)
koch(n, p1, p2)
print(p2.x, p2.y)
 import math math class Point:
    def __init__(self, x=None, y=None):
        self.x = x
        self.y = y Point def __init__(self, x=None, y=None):
        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=None x None y=None y None def koch(n, p1, p2):
    if n == 0:
        return
    s, t, u = [Point() for _ in range(3)]
    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
    a = math.radians(60)
    u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x
    u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y

    koch(n - 1, p1, s)
    print(s.x, s.y)
    koch(n - 1, s, u)
    print(u.x, u.y)
    koch(n - 1, u, t)
    print(t.x, t.y)
    koch(n - 1, t, p2) koch if n == 0:
        return
     n == 0 n 0 return Point() for _ in range(3) for _ in range(3) _ range(3) range 3 for _ in range(3) Point() Point s, t, u = [Point() for _ in range(3)] s [Point() for _ in range(3)] t u 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 a = math.radians(60) a math.radians(60) math.radians math radians 60 u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x u.x u x (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) (t.x - s.x) * math.cos(a) t.x - s.x t.x t x s.x s x math.cos(a) math.cos math cos a (t.y - s.y) * math.sin(a) t.y - s.y t.y t y s.y s y math.sin(a) math.sin math sin a s.x s x u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y u.y u y (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) (t.x - s.x) * math.sin(a) t.x - s.x t.x t x s.x s x math.sin(a) math.sin math sin a (t.y - s.y) * math.cos(a) t.y - s.y t.y t y s.y s y math.cos(a) math.cos math cos a s.y s y koch(n - 1, p1, s) koch n - 1 n 1 p1 s print(s.x, s.y) print s.x s x s.y s y koch(n - 1, s, u) koch n - 1 n 1 s u print(u.x, u.y) print u.x u x u.y u y koch(n - 1, u, t) koch n - 1 n 1 u t print(t.x, t.y) print t.x t x t.y t y koch(n - 1, t, p2) koch n - 1 n 1 t p2 n n p1 p1 p2 p2 p1 = Point(0, 0) p1 Point(0, 0) Point 0 0 p2 = Point(100, 0) p2 Point(100, 0) Point 100 0 n = int(input()) n int(input()) int input() input print(p1.x, p1.y) print p1.x p1 x p1.y p1 y koch(n, p1, p2) koch n p1 p2 print(p2.x, p2.y) print p2.x p2 x p2.y p2 y class Point:
    def __init__(self, x=None, y=None):
        self.x = x
        self.y = y class Point:
    def __init__(self, x=None, y=None):
        self.x = x
        self.y = y Point p1 = Point(0, 0) Point(0, 0) p1 def koch(n, p1, p2):
    if n == 0:
        return
    s, t, u = [Point() for _ in range(3)]
    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
    a = math.radians(60)
    u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x
    u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y

    koch(n - 1, p1, s)
    print(s.x, s.y)
    koch(n - 1, s, u)
    print(u.x, u.y)
    koch(n - 1, u, t)
    print(t.x, t.y)
    koch(n - 1, t, p2) def koch(n, p1, p2):
    if n == 0:
        return
    s, t, u = [Point() for _ in range(3)]
    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
    a = math.radians(60)
    u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x
    u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y

    koch(n - 1, p1, s)
    print(s.x, s.y)
    koch(n - 1, s, u)
    print(u.x, u.y)
    koch(n - 1, u, t)
    print(t.x, t.y)
    koch(n - 1, t, p2) koch p2 = Point(100, 0) Point(100, 0) p2 n = int(input()) int(input()) n
import math


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


def koch(n, p1, p2):
    if n == 0:
        return
    s, t, u = [Point() for _ in range(3)]
    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
    a = math.radians(60)
    u.x = (t.x - s.x) * math.cos(a) - (t.y - s.y) * math.sin(a) + s.x
    u.y = (t.x - s.x) * math.sin(a) + (t.y - s.y) * math.cos(a) + s.y

    koch(n - 1, p1, s)
    print(s.x, s.y)
    koch(n - 1, s, u)
    print(u.x, u.y)
    koch(n - 1, u, t)
    print(t.x, t.y)
    koch(n - 1, t, p2)


p1 = Point(0, 0)
p2 = Point(100, 0)
n = int(input())
print(p1.x, p1.y)
koch(n, p1, p2)
print(p2.x, p2.y)

