def rev(s, t):
    xa, ya = s
    xb, yb = t
    X = xb - xa
    Y = yb - ya

    return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya


def f(n):
    print(0, 0)
    _f((0, 0), (100, 0), 0, n - 1)
    print(100, 0)


def _f(p1, p2, n, end):

    if n > end:
        return
    xa, ya = p1
    xb, yb = p2
    s = xa + (xb - xa) / 3, ya + (yb - ya) / 3
    t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3
    u = rev(s, t)
    _f(p1, s, n + 1, end)
    print(s[0], s[1])
    _f(s, u, n + 1, end)
    print(u[0], u[1])
    _f(u, t, n + 1, end)
    print(t[0], t[1])
    _f(t, p2, n + 1, end)


def main():
    f(int(input()))


if __name__ == '__main__':
    main()
 def rev(s, t):
    xa, ya = s
    xb, yb = t
    X = xb - xa
    Y = yb - ya

    return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya rev xa, ya = s xa s ya xb, yb = t xb t yb X = xb - xa X xb - xa xb xa Y = yb - ya Y yb - ya yb ya return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya (X - (3 ** 0.5) * Y) / 2 + xa (X - (3 ** 0.5) * Y) / 2 X - (3 ** 0.5) * Y X (3 ** 0.5) * Y 3 ** 0.5 3 0.5 Y 2 xa (Y + (3 ** 0.5) * X) / 2 + ya (Y + (3 ** 0.5) * X) / 2 Y + (3 ** 0.5) * X Y (3 ** 0.5) * X 3 ** 0.5 3 0.5 X 2 ya s s t t def f(n):
    print(0, 0)
    _f((0, 0), (100, 0), 0, n - 1)
    print(100, 0) f print(0, 0) print 0 0 _f((0, 0), (100, 0), 0, n - 1) _f (0, 0) 0 0 (100, 0) 100 0 0 n - 1 n 1 print(100, 0) print 100 0 n n def _f(p1, p2, n, end):

    if n > end:
        return
    xa, ya = p1
    xb, yb = p2
    s = xa + (xb - xa) / 3, ya + (yb - ya) / 3
    t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3
    u = rev(s, t)
    _f(p1, s, n + 1, end)
    print(s[0], s[1])
    _f(s, u, n + 1, end)
    print(u[0], u[1])
    _f(u, t, n + 1, end)
    print(t[0], t[1])
    _f(t, p2, n + 1, end) _f if n > end:
        return
     n > end n end return xa, ya = p1 xa p1 ya xb, yb = p2 xb p2 yb s = xa + (xb - xa) / 3, ya + (yb - ya) / 3 s s = xa + (xb - xa) / 3, ya + (yb - ya) / 3 xa + (xb - xa) / 3 xa (xb - xa) / 3 xb - xa xb xa 3 ya + (yb - ya) / 3 ya (yb - ya) / 3 yb - ya yb ya 3 t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3 t t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3 xa + (xb - xa) * 2 / 3 xa (xb - xa) * 2 / 3 (xb - xa) * 2 xb - xa xb xa 2 3 ya + (yb - ya) * 2 / 3 ya (yb - ya) * 2 / 3 (yb - ya) * 2 yb - ya yb ya 2 3 u = rev(s, t) u rev(s, t) rev s t _f(p1, s, n + 1, end) _f p1 s n + 1 n 1 end print(s[0], s[1]) print s[0] s 0 s[1] s 1 _f(s, u, n + 1, end) _f s u n + 1 n 1 end print(u[0], u[1]) print u[0] u 0 u[1] u 1 _f(u, t, n + 1, end) _f u t n + 1 n 1 end print(t[0], t[1]) print t[0] t 0 t[1] t 1 _f(t, p2, n + 1, end) _f t p2 n + 1 n 1 end p1 p1 p2 p2 n n end end def main():
    f(int(input())) main f(int(input())) f int(input()) int input() input if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    f(int(input())) def main():
    f(int(input())) main def f(n):
    print(0, 0)
    _f((0, 0), (100, 0), 0, n - 1)
    print(100, 0) def f(n):
    print(0, 0)
    _f((0, 0), (100, 0), 0, n - 1)
    print(100, 0) f def rev(s, t):
    xa, ya = s
    xb, yb = t
    X = xb - xa
    Y = yb - ya

    return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya def rev(s, t):
    xa, ya = s
    xb, yb = t
    X = xb - xa
    Y = yb - ya

    return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya rev def _f(p1, p2, n, end):

    if n > end:
        return
    xa, ya = p1
    xb, yb = p2
    s = xa + (xb - xa) / 3, ya + (yb - ya) / 3
    t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3
    u = rev(s, t)
    _f(p1, s, n + 1, end)
    print(s[0], s[1])
    _f(s, u, n + 1, end)
    print(u[0], u[1])
    _f(u, t, n + 1, end)
    print(t[0], t[1])
    _f(t, p2, n + 1, end) def _f(p1, p2, n, end):

    if n > end:
        return
    xa, ya = p1
    xb, yb = p2
    s = xa + (xb - xa) / 3, ya + (yb - ya) / 3
    t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3
    u = rev(s, t)
    _f(p1, s, n + 1, end)
    print(s[0], s[1])
    _f(s, u, n + 1, end)
    print(u[0], u[1])
    _f(u, t, n + 1, end)
    print(t[0], t[1])
    _f(t, p2, n + 1, end) _f
def rev(s, t):
    xa, ya = s
    xb, yb = t
    X = xb - xa
    Y = yb - ya

    return (X - (3 ** 0.5) * Y) / 2 + xa, (Y + (3 ** 0.5) * X) / 2 + ya


def f(n):
    print(0, 0)
    _f((0, 0), (100, 0), 0, n - 1)
    print(100, 0)


def _f(p1, p2, n, end):

    if n > end:
        return
    xa, ya = p1
    xb, yb = p2
    s = xa + (xb - xa) / 3, ya + (yb - ya) / 3
    t = xa + (xb - xa) * 2 / 3, ya + (yb - ya) * 2 / 3
    u = rev(s, t)
    _f(p1, s, n + 1, end)
    print(s[0], s[1])
    _f(s, u, n + 1, end)
    print(u[0], u[1])
    _f(u, t, n + 1, end)
    print(t[0], t[1])
    _f(t, p2, n + 1, end)


def main():
    f(int(input()))


if __name__ == '__main__':
    main()

