import math

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

def koch(n, a, b):
    if n == 0:
        return 0

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)
    th = math.pi * 60.0 / 180

    s.x = (2.0 * a.x + b.x) / 3
    s.y = (2.0 * a.y + b.y) / 3
    t.x = (a.x + 2.0 * b.x) / 3
    t.y = (a.y + 2.0 * b.y) / 3
    u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
    u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y

    koch(n - 1, a, s)
    print("{:.6f} {:.6f}".format(s.x, s.y))
    koch(n - 1, s, u)
    print("{:.6f} {:.6f}".format(u.x, u.y))
    koch(n - 1, u, t)
    print("{:.6f} {:.6f}".format(t.x, t.y))
    koch(n - 1, t, b)

    return 0

a = Point(0.0, 0.0)
b = Point(100.0, 0.0)

n = int(input())

print("{:.6f} {:.6f}".format(a.x, a.y))
koch(n, a, b)
print("{:.6f} {:.6f}".format(b.x, b.y)) import math math class Point:
    def __init__(self, a, b):
        self.x = a
        self.y = b Point def __init__(self, a, b):
        self.x = a
        self.y = b __init__ self.x = a self.x self x a self.y = b self.y self y b self self a a b b def koch(n, a, b):
    if n == 0:
        return 0

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)
    th = math.pi * 60.0 / 180

    s.x = (2.0 * a.x + b.x) / 3
    s.y = (2.0 * a.y + b.y) / 3
    t.x = (a.x + 2.0 * b.x) / 3
    t.y = (a.y + 2.0 * b.y) / 3
    u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
    u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y

    koch(n - 1, a, s)
    print("{:.6f} {:.6f}".format(s.x, s.y))
    koch(n - 1, s, u)
    print("{:.6f} {:.6f}".format(u.x, u.y))
    koch(n - 1, u, t)
    print("{:.6f} {:.6f}".format(t.x, t.y))
    koch(n - 1, t, b)

    return 0 koch if n == 0:
        return 0

     n == 0 n 0 return 0 0 s = Point(0, 0) s Point(0, 0) Point 0 0 t = Point(0, 0) t Point(0, 0) Point 0 0 u = Point(0, 0) u Point(0, 0) Point 0 0 th = math.pi * 60.0 / 180 th math.pi * 60.0 / 180 math.pi * 60.0 math.pi math pi 60.0 180 s.x = (2.0 * a.x + b.x) / 3 s.x s x (2.0 * a.x + b.x) / 3 2.0 * a.x + b.x 2.0 * a.x 2.0 a.x a x b.x b x 3 s.y = (2.0 * a.y + b.y) / 3 s.y s y (2.0 * a.y + b.y) / 3 2.0 * a.y + b.y 2.0 * a.y 2.0 a.y a y b.y b y 3 t.x = (a.x + 2.0 * b.x) / 3 t.x t x (a.x + 2.0 * b.x) / 3 a.x + 2.0 * b.x a.x a x 2.0 * b.x 2.0 b.x b x 3 t.y = (a.y + 2.0 * b.y) / 3 t.y t y (a.y + 2.0 * b.y) / 3 a.y + 2.0 * b.y a.y a y 2.0 * b.y 2.0 b.y b y 3 u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x u.x u x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) (t.x - s.x) * math.cos(th) t.x - s.x t.x t x s.x s x math.cos(th) math.cos math cos th (t.y - s.y) * math.sin(th) t.y - s.y t.y t y s.y s y math.sin(th) math.sin math sin th s.x s x u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y u.y u y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) (t.x - s.x) * math.sin(th) t.x - s.x t.x t x s.x s x math.sin(th) math.sin math sin th (t.y - s.y) * math.cos(th) t.y - s.y t.y t y s.y s y math.cos(th) math.cos math cos th s.y s y koch(n - 1, a, s) koch n - 1 n 1 a s print("{:.6f} {:.6f}".format(s.x, s.y)) print "{:.6f} {:.6f}".format(s.x, s.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format s.x s x s.y s y koch(n - 1, s, u) koch n - 1 n 1 s u print("{:.6f} {:.6f}".format(u.x, u.y)) print "{:.6f} {:.6f}".format(u.x, u.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format u.x u x u.y u y koch(n - 1, u, t) koch n - 1 n 1 u t print("{:.6f} {:.6f}".format(t.x, t.y)) print "{:.6f} {:.6f}".format(t.x, t.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format t.x t x t.y t y koch(n - 1, t, b) koch n - 1 n 1 t b return 0 0 n n a a b b a = Point(0.0, 0.0) a Point(0.0, 0.0) Point 0.0 0.0 b = Point(100.0, 0.0) b Point(100.0, 0.0) Point 100.0 0.0 n = int(input()) n int(input()) int input() input print("{:.6f} {:.6f}".format(a.x, a.y)) print "{:.6f} {:.6f}".format(a.x, a.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format a.x a x a.y a y koch(n, a, b) koch n a b print("{:.6f} {:.6f}".format(b.x, b.y)) print "{:.6f} {:.6f}".format(b.x, b.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format b.x b x b.y b y def koch(n, a, b):
    if n == 0:
        return 0

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)
    th = math.pi * 60.0 / 180

    s.x = (2.0 * a.x + b.x) / 3
    s.y = (2.0 * a.y + b.y) / 3
    t.x = (a.x + 2.0 * b.x) / 3
    t.y = (a.y + 2.0 * b.y) / 3
    u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
    u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y

    koch(n - 1, a, s)
    print("{:.6f} {:.6f}".format(s.x, s.y))
    koch(n - 1, s, u)
    print("{:.6f} {:.6f}".format(u.x, u.y))
    koch(n - 1, u, t)
    print("{:.6f} {:.6f}".format(t.x, t.y))
    koch(n - 1, t, b)

    return 0 def koch(n, a, b):
    if n == 0:
        return 0

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)
    th = math.pi * 60.0 / 180

    s.x = (2.0 * a.x + b.x) / 3
    s.y = (2.0 * a.y + b.y) / 3
    t.x = (a.x + 2.0 * b.x) / 3
    t.y = (a.y + 2.0 * b.y) / 3
    u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
    u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y

    koch(n - 1, a, s)
    print("{:.6f} {:.6f}".format(s.x, s.y))
    koch(n - 1, s, u)
    print("{:.6f} {:.6f}".format(u.x, u.y))
    koch(n - 1, u, t)
    print("{:.6f} {:.6f}".format(t.x, t.y))
    koch(n - 1, t, b)

    return 0 koch class Point:
    def __init__(self, a, b):
        self.x = a
        self.y = b class Point:
    def __init__(self, a, b):
        self.x = a
        self.y = b Point n = int(input()) int(input()) n b = Point(100.0, 0.0) Point(100.0, 0.0) b a = Point(0.0, 0.0) Point(0.0, 0.0) a
import math

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

def koch(n, a, b):
    if n == 0:
        return 0

    s = Point(0, 0)
    t = Point(0, 0)
    u = Point(0, 0)
    th = math.pi * 60.0 / 180

    s.x = (2.0 * a.x + b.x) / 3
    s.y = (2.0 * a.y + b.y) / 3
    t.x = (a.x + 2.0 * b.x) / 3
    t.y = (a.y + 2.0 * b.y) / 3
    u.x = (t.x - s.x) * math.cos(th) - (t.y - s.y) * math.sin(th) + s.x
    u.y = (t.x - s.x) * math.sin(th) + (t.y - s.y) * math.cos(th) + s.y

    koch(n - 1, a, s)
    print("{:.6f} {:.6f}".format(s.x, s.y))
    koch(n - 1, s, u)
    print("{:.6f} {:.6f}".format(u.x, u.y))
    koch(n - 1, u, t)
    print("{:.6f} {:.6f}".format(t.x, t.y))
    koch(n - 1, t, b)

    return 0

a = Point(0.0, 0.0)
b = Point(100.0, 0.0)

n = int(input())

print("{:.6f} {:.6f}".format(a.x, a.y))
koch(n, a, b)
print("{:.6f} {:.6f}".format(b.x, b.y))