#!/usr/bin/env python3
# -*- coding: utf-8 -*-


SIN60 = 0.86602540378
COS60 = 0.5


class KochCurve(object):

    def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

    def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

    def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init)


def main():
    k = KochCurve(n=int(input()))
    k.draw_koch()
    for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1]))


if __name__ == "__main__":
    main() SIN60 = 0.86602540378 SIN60 0.86602540378 COS60 = 0.5 COS60 0.5 class KochCurve(object):

    def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

    def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

    def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init) KochCurve def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

     __init__ self.depth = n self.depth self depth n self.p1_init = p1 self.p1_init self p1_init p1 self.p2_init = p2 self.p2_init self p2_init p2 self.points = [p1] self.points self points [p1] p1 self self n n p1=(0.0, 0.0) p1 (0.0, 0.0) 0.0 0.0 p2=(100.0, 0.0) p2 (100.0, 0.0) 100.0 0.0 def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

     koch if n is None:
            n = self.depth
         n is None n None n = self.depth n self.depth self depth if p1 is None:
            p1 = self.p1_init
         p1 is None p1 None p1 = self.p1_init p1 self.p1_init self p1_init if p2 is None:
            p2 = self.p2_init
         p2 is None p2 None p2 = self.p2_init p2 self.p2_init self p2_init if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

     n != 0 n 0 s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3) s ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3) (2 * p1[0] + p2[0]) / 3 2 * p1[0] + p2[0] 2 * p1[0] 2 p1[0] p1 0 p2[0] p2 0 3 (2 * p1[1] + p2[1]) / 3 2 * p1[1] + p2[1] 2 * p1[1] 2 p1[1] p1 1 p2[1] p2 1 3 t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3) t ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3) (p1[0] + 2 * p2[0]) / 3 p1[0] + 2 * p2[0] p1[0] p1 0 2 * p2[0] 2 p2[0] p2 0 3 (p1[1] + 2 * p2[1]) / 3 p1[1] + 2 * p2[1] p1[1] p1 1 2 * p2[1] 2 p2[1] p2 1 3 ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0] ux (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0] (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 (t[0] - s[0]) * COS60 t[0] - s[0] t[0] t 0 s[0] s 0 COS60 (t[1] - s[1]) * SIN60 t[1] - s[1] t[1] t 1 s[1] s 1 SIN60 s[0] s 0 uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1] uy (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1] (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 (t[0] - s[0]) * SIN60 t[0] - s[0] t[0] t 0 s[0] s 0 SIN60 (t[1] - s[1]) * COS60 t[1] - s[1] t[1] t 1 s[1] s 1 COS60 s[1] s 1 u = (ux, uy) u (ux, uy) ux uy self.koch(n - 1, p1, s) self.koch self koch n - 1 n 1 p1 s self.points.append(s) self.points.append self.points self points append s self.koch(n - 1, s, u) self.koch self koch n - 1 n 1 s u self.points.append(u) self.points.append self.points self points append u self.koch(n - 1, u, t) self.koch self koch n - 1 n 1 u t self.points.append(t) self.points.append self.points self points append t self.koch(n - 1, t, p2) self.koch self koch n - 1 n 1 t p2 self self n=None n None p1=None p1 None p2=None p2 None def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init) draw_koch self.koch() self.koch self koch self.points.append(self.p2_init) self.points.append self.points self points append self.p2_init self p2_init self self object def main():
    k = KochCurve(n=int(input()))
    k.draw_koch()
    for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1])) main k = KochCurve(n=int(input())) k KochCurve(n=int(input())) KochCurve n=int(input()) n int(input()) int input() input k.draw_koch() k.draw_koch k draw_koch for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1])) p k.points k points print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1])) print "{x:.8f} {y:.8f}".format(x=p[0], y=p[1]) "{x:.8f} {y:.8f}".format "{x:.8f} {y:.8f}" format x=p[0] x p[0] p 0 y=p[1] y p[1] p 1 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    k = KochCurve(n=int(input()))
    k.draw_koch()
    for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1])) def main():
    k = KochCurve(n=int(input()))
    k.draw_koch()
    for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1])) main COS60 = 0.5 0.5 COS60 SIN60 = 0.86602540378 0.86602540378 SIN60 class KochCurve(object):

    def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

    def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

    def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init) class KochCurve(object):

    def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

    def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

    def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init) KochCurve
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


SIN60 = 0.86602540378
COS60 = 0.5


class KochCurve(object):

    def __init__(self, n, p1=(0.0, 0.0), p2=(100.0, 0.0)):
        self.depth = n
        self.p1_init = p1
        self.p2_init = p2
        self.points = [p1]

    def koch(self, n=None, p1=None, p2=None):
        if n is None:
            n = self.depth
        if p1 is None:
            p1 = self.p1_init
        if p2 is None:
            p2 = self.p2_init
        if n != 0:
            s = ((2 * p1[0] + p2[0]) / 3, (2 * p1[1] + p2[1]) / 3)
            t = ((p1[0] + 2 * p2[0]) / 3, (p1[1] + 2 * p2[1]) / 3)
            ux = (t[0] - s[0]) * COS60 - (t[1] - s[1]) * SIN60 + s[0]
            uy = (t[0] - s[0]) * SIN60 + (t[1] - s[1]) * COS60 + s[1]
            u = (ux, uy)
            self.koch(n - 1, p1, s)
            self.points.append(s)
            self.koch(n - 1, s, u)
            self.points.append(u)
            self.koch(n - 1, u, t)
            self.points.append(t)
            self.koch(n - 1, t, p2)

    def draw_koch(self):
        self.koch()
        self.points.append(self.p2_init)


def main():
    k = KochCurve(n=int(input()))
    k.draw_koch()
    for p in k.points:
        print("{x:.8f} {y:.8f}".format(x=p[0], y=p[1]))


if __name__ == "__main__":
    main()