from decimal import Decimal
from math import cos, radians, sin



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

    def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

    def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t


def kock(n, point1, point2):
    if n == 0:
        return


    s, u, t = point1.calc_koch_apex(point2)
    
    kock(n-1, point1, s)

    s.output()

    kock(n-1, s, u)

    u.output()

    kock(n-1, u, t)

    t.output()

    kock(n-1, t, point2)




n = int(input())

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


p1.output()

kock(n, p1, p2)

p2.output()
 from decimal import Decimal from math import cos, radians, sin class Point():
    def __init__(self, x, y):
        self.x = Decimal(x)
        self.y = Decimal(y)

    def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

    def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t Point def __init__(self, x, y):
        self.x = Decimal(x)
        self.y = Decimal(y)

     __init__ self.x = Decimal(x) self.x self x Decimal(x) Decimal x self.y = Decimal(y) self.y self y Decimal(y) Decimal y self self x x y y def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

     output print("{:.6f} {:.6f}".format(self.x, self.y)) print "{:.6f} {:.6f}".format(self.x, self.y) "{:.6f} {:.6f}".format "{:.6f} {:.6f}" format self.x self x self.y self y self self def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t calc_koch_apex s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x s_x Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x Decimal(2) / Decimal(3) * self.x Decimal(2) / Decimal(3) Decimal(2) Decimal 2 Decimal(3) Decimal 3 self.x self x Decimal(1) / Decimal(3) * point.x Decimal(1) / Decimal(3) Decimal(1) Decimal 1 Decimal(3) Decimal 3 point.x point x s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y s_y Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y Decimal(2) / Decimal(3) * self.y Decimal(2) / Decimal(3) Decimal(2) Decimal 2 Decimal(3) Decimal 3 self.y self y Decimal(1) / Decimal(3) * point.y Decimal(1) / Decimal(3) Decimal(1) Decimal 1 Decimal(3) Decimal 3 point.y point y s = Point(s_x, s_y) s Point(s_x, s_y) Point s_x s_y t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x t_x Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x Decimal(1) / Decimal(3) * self.x Decimal(1) / Decimal(3) Decimal(1) Decimal 1 Decimal(3) Decimal 3 self.x self x Decimal(2) / Decimal(3) * point.x Decimal(2) / Decimal(3) Decimal(2) Decimal 2 Decimal(3) Decimal 3 point.x point x t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y t_y Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y Decimal(1) / Decimal(3) * self.y Decimal(1) / Decimal(3) Decimal(1) Decimal 1 Decimal(3) Decimal 3 self.y self y Decimal(2) / Decimal(3) * point.y Decimal(2) / Decimal(3) Decimal(2) Decimal 2 Decimal(3) Decimal 3 point.y point y t = Point(t_x, t_y) t Point(t_x, t_y) Point t_x t_y u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x u_x (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) (t.x - s.x) * Decimal(cos(radians(60))) t.x - s.x t.x t x s.x s x Decimal(cos(radians(60))) Decimal cos(radians(60)) cos radians(60) radians 60 (t.y - s.y) * Decimal(sin(radians(60))) t.y - s.y t.y t y s.y s y Decimal(sin(radians(60))) Decimal sin(radians(60)) sin radians(60) radians 60 s.x s x u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y u_y (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) (t.x - s.x) * Decimal(sin(radians(60))) t.x - s.x t.x t x s.x s x Decimal(sin(radians(60))) Decimal sin(radians(60)) sin radians(60) radians 60 (t.y - s.y) * Decimal(cos(radians(60))) t.y - s.y t.y t y s.y s y Decimal(cos(radians(60))) Decimal cos(radians(60)) cos radians(60) radians 60 s.y s y u = Point(u_x, u_y) u Point(u_x, u_y) Point u_x u_y return s, u, t return s, u, t s u t self self point point def kock(n, point1, point2):
    if n == 0:
        return


    s, u, t = point1.calc_koch_apex(point2)
    
    kock(n-1, point1, s)

    s.output()

    kock(n-1, s, u)

    u.output()

    kock(n-1, u, t)

    t.output()

    kock(n-1, t, point2) kock if n == 0:
        return


     n == 0 n 0 return s, u, t = point1.calc_koch_apex(point2) s point1.calc_koch_apex(point2) point1.calc_koch_apex point1 calc_koch_apex point2 u t kock(n-1, point1, s) kock n-1 n 1 point1 s s.output() s.output s output kock(n-1, s, u) kock n-1 n 1 s u u.output() u.output u output kock(n-1, u, t) kock n-1 n 1 u t t.output() t.output t output kock(n-1, t, point2) kock n-1 n 1 t point2 n n point1 point1 point2 point2 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.output() p1.output p1 output kock(n, p1, p2) kock n p1 p2 p2.output() p2.output p2 output n = int(input()) int(input()) n p2 = Point(100, 0) Point(100, 0) p2 class Point():
    def __init__(self, x, y):
        self.x = Decimal(x)
        self.y = Decimal(y)

    def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

    def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t class Point():
    def __init__(self, x, y):
        self.x = Decimal(x)
        self.y = Decimal(y)

    def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

    def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t Point def kock(n, point1, point2):
    if n == 0:
        return


    s, u, t = point1.calc_koch_apex(point2)
    
    kock(n-1, point1, s)

    s.output()

    kock(n-1, s, u)

    u.output()

    kock(n-1, u, t)

    t.output()

    kock(n-1, t, point2) def kock(n, point1, point2):
    if n == 0:
        return


    s, u, t = point1.calc_koch_apex(point2)
    
    kock(n-1, point1, s)

    s.output()

    kock(n-1, s, u)

    u.output()

    kock(n-1, u, t)

    t.output()

    kock(n-1, t, point2) kock p1 = Point(0, 0) Point(0, 0) p1
from decimal import Decimal
from math import cos, radians, sin



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

    def output(self):
        print("{:.6f} {:.6f}".format(self.x, self.y))

    def calc_koch_apex(self, point):
        s_x = Decimal(2) / Decimal(3) * self.x + Decimal(1) / Decimal(3) * point.x
        s_y = Decimal(2) / Decimal(3) * self.y + Decimal(1) / Decimal(3) * point.y
        s = Point(s_x, s_y)

        t_x = Decimal(1) / Decimal(3) * self.x + Decimal(2) / Decimal(3) * point.x
        t_y = Decimal(1) / Decimal(3) * self.y + Decimal(2) / Decimal(3) * point.y
        t = Point(t_x, t_y)

        u_x = (t.x - s.x) * Decimal(cos(radians(60))) - \
              (t.y - s.y) * Decimal(sin(radians(60))) + s.x
        u_y = (t.x - s.x) * Decimal(sin(radians(60))) + \
              (t.y - s.y) * Decimal(cos(radians(60))) + s.y
        u = Point(u_x, u_y)

        return s, u, t


def kock(n, point1, point2):
    if n == 0:
        return


    s, u, t = point1.calc_koch_apex(point2)
    
    kock(n-1, point1, s)

    s.output()

    kock(n-1, s, u)

    u.output()

    kock(n-1, u, t)

    t.output()

    kock(n-1, t, point2)




n = int(input())

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


p1.output()

kock(n, p1, p2)

p2.output()

