import math

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

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

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

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

def main():
    n = int(input())

    p1 = Point(0, 0)
    p2 = Point(100, 0)

    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)

main() import math math class Point():
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y Point def __init__(self, x=0, y=0):
        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=0 x 0 y=0 y 0 def koch(d, p1, p2):
    if d == 0:
        return

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

        koch(d - 1, p1, s)
        print(s.x, s.y)
        koch(d - 1, s, u)
        print(u.x, u.y)
        koch(d - 1, u, t)
        print(t.x, t.y)
        koch(d - 1, t, p2) koch if d == 0:
        return

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

        koch(d - 1, p1, s)
        print(s.x, s.y)
        koch(d - 1, s, u)
        print(u.x, u.y)
        koch(d - 1, u, t)
        print(t.x, t.y)
        koch(d - 1, t, p2) d == 0 d 0 return s = Point() s Point() Point t = Point() t Point() Point u = Point() u Point() Point s.x = (2*p1.x + 1*p2.x)/3.0 s.x s x (2*p1.x + 1*p2.x)/3.0 2*p1.x + 1*p2.x 2*p1.x 2 p1.x p1 x 1*p2.x 1 p2.x p2 x 3.0 s.y = (2*p1.y + 1*p2.y)/3.0 s.y s y (2*p1.y + 1*p2.y)/3.0 2*p1.y + 1*p2.y 2*p1.y 2 p1.y p1 y 1*p2.y 1 p2.y p2 y 3.0 t.x = (1*p1.x + 2*p2.x)/3.0 t.x t x (1*p1.x + 2*p2.x)/3.0 1*p1.x + 2*p2.x 1*p1.x 1 p1.x p1 x 2*p2.x 2 p2.x p2 x 3.0 t.y = (1*p1.y + 2*p2.y)/3.0 t.y t y (1*p1.y + 2*p2.y)/3.0 1*p1.y + 2*p2.y 1*p1.y 1 p1.y p1 y 2*p2.y 2 p2.y p2 y 3.0 u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y) u.x u x s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y) s.x + math.cos(math.radians(60)) * (t.x - s.x) s.x s x math.cos(math.radians(60)) * (t.x - s.x) math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 t.x - s.x t.x t x s.x s x math.sin(math.radians(60)) * (t.y - s.y) math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 t.y - s.y t.y t y s.y s y u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y) u.y u y s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y) s.y + math.sin(math.radians(60)) * (t.x - s.x) s.y s y math.sin(math.radians(60)) * (t.x - s.x) math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 t.x - s.x t.x t x s.x s x math.cos(math.radians(60)) * (t.y - s.y) math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 t.y - s.y t.y t y s.y s y koch(d - 1, p1, s) koch d - 1 d 1 p1 s print(s.x, s.y) print s.x s x s.y s y koch(d - 1, s, u) koch d - 1 d 1 s u print(u.x, u.y) print u.x u x u.y u y koch(d - 1, u, t) koch d - 1 d 1 u t print(t.x, t.y) print t.x t x t.y t y koch(d - 1, t, p2) koch d - 1 d 1 t p2 d d p1 p1 p2 p2 def main():
    n = int(input())

    p1 = Point(0, 0)
    p2 = Point(100, 0)

    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y) 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 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 main() main class Point():
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y class Point():
    def __init__(self, x=0, y=0):
        self.x = x
        self.y = y Point def main():
    n = int(input())

    p1 = Point(0, 0)
    p2 = Point(100, 0)

    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y) def main():
    n = int(input())

    p1 = Point(0, 0)
    p2 = Point(100, 0)

    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y) main def koch(d, p1, p2):
    if d == 0:
        return

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

        koch(d - 1, p1, s)
        print(s.x, s.y)
        koch(d - 1, s, u)
        print(u.x, u.y)
        koch(d - 1, u, t)
        print(t.x, t.y)
        koch(d - 1, t, p2) def koch(d, p1, p2):
    if d == 0:
        return

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

        koch(d - 1, p1, s)
        print(s.x, s.y)
        koch(d - 1, s, u)
        print(u.x, u.y)
        koch(d - 1, u, t)
        print(t.x, t.y)
        koch(d - 1, t, p2) koch
import math

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

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

    else:
        s = Point()
        t = Point()
        u = Point()

        s.x = (2*p1.x + 1*p2.x)/3.0
        s.y = (2*p1.y + 1*p2.y)/3.0

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

        u.x = s.x + math.cos(math.radians(60)) * (t.x - s.x) - math.sin(math.radians(60)) * (t.y - s.y)
        u.y = s.y + math.sin(math.radians(60)) * (t.x - s.x) + math.cos(math.radians(60)) * (t.y - s.y)

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

def main():
    n = int(input())

    p1 = Point(0, 0)
    p2 = Point(100, 0)

    print(p1.x, p1.y)
    koch(n, p1, p2)
    print(p2.x, p2.y)

main()
