import math

class point:

    def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

    def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

    @property
    def x(self):
        return self._x

    @property
    def y(self):
        return self._y


def get_s(p1, p2):
    p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3))
    return p


def get_t(p1, p2):
    p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2))
    return p


def get_u(s, t):
    x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x
    y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y
    return point((x, y))


def kock(n, p1, p2):
    if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return


if __name__ == '__main__':

    n = int(input())

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

    p1.disp()
    kock(n, p1, p2)
    p2.disp() import math math class point:

    def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

    def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

    @property
    def x(self):
        return self._x

    @property
    def y(self):
        return self._y point def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

     __init__ self._x = p[0] self._x self _x p[0] p 0 self._y = p[1] self._y self _y p[1] p 1 self self p p def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

     disp print("{0:f} {1:f}".format(self._x, self._y)) print "{0:f} {1:f}".format(self._x, self._y) "{0:f} {1:f}".format "{0:f} {1:f}" format self._x self _x self._y self _y self self def x(self):
        return self._x

     x return self._x self._x self _x self self @property
     x property x def y(self):
        return self._y y return self._y self._y self _y self self @property
     y property y def get_s(p1, p2):
    p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3))
    return p get_s p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3)) p point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3)) point (p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3) p1.x/3*2 + p2.x/3 p1.x/3*2 p1.x/3 p1.x p1 x 3 2 p2.x/3 p2.x p2 x 3 p1.y/3*2 + p2.y/3 p1.y/3*2 p1.y/3 p1.y p1 y 3 2 p2.y/3 p2.y p2 y 3 return p p p1 p1 p2 p2 def get_t(p1, p2):
    p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2))
    return p get_t p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2)) p point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2)) point (p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2) p1.x/3 + p2.x/3*2 p1.x/3 p1.x p1 x 3 p2.x/3*2 p2.x/3 p2.x p2 x 3 2 p1.y/3 + p2.y/3*2 p1.y/3 p1.y p1 y 3 p2.y/3*2 p2.y/3 p2.y p2 y 3 2 return p p p1 p1 p2 p2 def get_u(s, t):
    x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x
    y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y
    return point((x, y)) get_u x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x x (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) (t.x - s.x)*math.cos(math.radians(60)) t.x - s.x t.x t x s.x s x math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 (t.y - s.y)*math.sin(math.radians(60)) t.y - s.y t.y t y s.y s y math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 s.x s x y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y y (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) (t.x - s.x)*math.sin(math.radians(60)) t.x - s.x t.x t x s.x s x math.sin(math.radians(60)) math.sin math sin math.radians(60) math.radians math radians 60 (t.y - s.y)*math.cos(math.radians(60)) t.y - s.y t.y t y s.y s y math.cos(math.radians(60)) math.cos math cos math.radians(60) math.radians math radians 60 s.y s y return point((x, y)) point((x, y)) point (x, y) x y s s t t def kock(n, p1, p2):
    if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return kock if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return n == 0 n 0 return s = get_s(p1, p2) s get_s(p1, p2) get_s p1 p2 t = get_t(p1, p2) t get_t(p1, p2) get_t p1 p2 u = get_u(s, t) u get_u(s, t) get_u s t kock(n-1, p1, s) kock n-1 n 1 p1 s s.disp() s.disp s disp kock(n-1, s, u) kock n-1 n 1 s u u.disp() u.disp u disp kock(n-1, u, t) kock n-1 n 1 u t t.disp() t.disp t disp kock(n-1, t, p2) kock n-1 n 1 t p2 return n n p1 p1 p2 p2 if __name__ == '__main__':

    n = int(input())

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

    p1.disp()
    kock(n, p1, p2)
    p2.disp() __name__ == '__main__' __name__ '__main__' n = int(input()) n int(input()) int input() input p1 = point((0, 0)) p1 point((0, 0)) point (0, 0) 0 0 p2 = point((100, 0)) p2 point((100, 0)) point (100, 0) 100 0 p1.disp() p1.disp p1 disp kock(n, p1, p2) kock n p1 p2 p2.disp() p2.disp p2 disp def get_u(s, t):
    x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x
    y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y
    return point((x, y)) def get_u(s, t):
    x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x
    y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y
    return point((x, y)) get_u p1 = point((0, 0)) point((0, 0)) p1 def get_t(p1, p2):
    p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2))
    return p def get_t(p1, p2):
    p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2))
    return p get_t class point:

    def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

    def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

    @property
    def x(self):
        return self._x

    @property
    def y(self):
        return self._y class point:

    def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

    def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

    @property
    def x(self):
        return self._x

    @property
    def y(self):
        return self._y point n = int(input()) int(input()) n def get_s(p1, p2):
    p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3))
    return p def get_s(p1, p2):
    p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3))
    return p get_s def kock(n, p1, p2):
    if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return def kock(n, p1, p2):
    if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return kock p2 = point((100, 0)) point((100, 0)) p2
import math

class point:

    def __init__(self, p):
        self._x = p[0]
        self._y = p[1]

    def disp(self):
        print("{0:f} {1:f}".format(self._x, self._y))

    @property
    def x(self):
        return self._x

    @property
    def y(self):
        return self._y


def get_s(p1, p2):
    p = point((p1.x/3*2 + p2.x/3, p1.y/3*2 + p2.y/3))
    return p


def get_t(p1, p2):
    p = point((p1.x/3 + p2.x/3*2, p1.y/3 + p2.y/3*2))
    return p


def get_u(s, t):
    x = (t.x - s.x)*math.cos(math.radians(60)) - (t.y - s.y)*math.sin(math.radians(60)) + s.x
    y = (t.x - s.x)*math.sin(math.radians(60)) + (t.y - s.y)*math.cos(math.radians(60)) + s.y
    return point((x, y))


def kock(n, p1, p2):
    if n == 0:
        return
    else:
        s = get_s(p1, p2)
        t = get_t(p1, p2)
        u = get_u(s, t)

        kock(n-1, p1, s)
        s.disp()
        kock(n-1, s, u)
        u.disp()
        kock(n-1, u, t)
        t.disp()
        kock(n-1, t, p2)

        return


if __name__ == '__main__':

    n = int(input())

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

    p1.disp()
    kock(n, p1, p2)
    p2.disp()
