import math


def solve(depth, p1, p2):
    if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2)


def main():
    n = int(input())
    print("%f %f" % (0, 0))
    solve(n, [0, 0], [100, 0])
    print("%f %f" % (100, 0))


if __name__ == '__main__':
    main()
 import math math def solve(depth, p1, p2):
    if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2) solve if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2) depth == 0 depth 0 return px = (p2[0] - p1[0]) / 3 px (p2[0] - p1[0]) / 3 p2[0] - p1[0] p2[0] p2 0 p1[0] p1 0 3 py = (p2[1] - p1[1]) / 3 py (p2[1] - p1[1]) / 3 p2[1] - p1[1] p2[1] p2 1 p1[1] p1 1 3 s = [p1[0] + px, p1[1] + py] s [p1[0] + px, p1[1] + py] p1[0] + px p1[0] p1 0 px p1[1] + py p1[1] p1 1 py t = [p1[0] + 2 * px, p1[1] + 2 * py] t [p1[0] + 2 * px, p1[1] + 2 * py] p1[0] + 2 * px p1[0] p1 0 2 * px 2 px p1[1] + 2 * py p1[1] p1 1 2 * py 2 py u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]] u [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]] (t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0] (t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) (t[0] - s[0]) * math.cos(math.pi/3) t[0] - s[0] t[0] t 0 s[0] s 0 math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 (t[1] - s[1]) * math.sin(math.pi/3) t[1] - s[1] t[1] t 1 s[1] s 1 math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 s[0] s 0 (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1] (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) (t[0] - s[0]) * math.sin(math.pi/3) t[0] - s[0] t[0] t 0 s[0] s 0 math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 (t[1] - s[1]) * math.cos(math.pi/3) t[1] - s[1] t[1] t 1 s[1] s 1 math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 s[1] s 1 solve(depth-1, p1, s) solve depth-1 depth 1 p1 s print(*s) print *s s solve(depth-1, s, u) solve depth-1 depth 1 s u print(*u) print *u u solve(depth-1, u, t) solve depth-1 depth 1 u t print(*t) print *t t solve(depth-1, t, p2) solve depth-1 depth 1 t p2 depth depth p1 p1 p2 p2 def main():
    n = int(input())
    print("%f %f" % (0, 0))
    solve(n, [0, 0], [100, 0])
    print("%f %f" % (100, 0)) main n = int(input()) n int(input()) int input() input print("%f %f" % (0, 0)) print "%f %f" % (0, 0) "%f %f" (0, 0) 0 0 solve(n, [0, 0], [100, 0]) solve n [0, 0] 0 0 [100, 0] 100 0 print("%f %f" % (100, 0)) print "%f %f" % (100, 0) "%f %f" (100, 0) 100 0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    print("%f %f" % (0, 0))
    solve(n, [0, 0], [100, 0])
    print("%f %f" % (100, 0)) def main():
    n = int(input())
    print("%f %f" % (0, 0))
    solve(n, [0, 0], [100, 0])
    print("%f %f" % (100, 0)) main def solve(depth, p1, p2):
    if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2) def solve(depth, p1, p2):
    if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2) solve
import math


def solve(depth, p1, p2):
    if depth == 0:
        return
    else:
        px = (p2[0] - p1[0]) / 3
        py = (p2[1] - p1[1]) / 3
        s = [p1[0] + px, p1[1] + py]
        t = [p1[0] + 2 * px, p1[1] + 2 * py]
        u = [(t[0] - s[0]) * math.cos(math.pi/3) -
             (t[1] - s[1]) * math.sin(math.pi/3) + s[0],
             (t[0] - s[0]) * math.sin(math.pi/3) +
             (t[1] - s[1]) * math.cos(math.pi/3) + s[1]]
        solve(depth-1, p1, s)
        print(*s)
        solve(depth-1, s, u)
        print(*u)
        solve(depth-1, u, t)
        print(*t)
        solve(depth-1, t, p2)


def main():
    n = int(input())
    print("%f %f" % (0, 0))
    solve(n, [0, 0], [100, 0])
    print("%f %f" % (100, 0))


if __name__ == '__main__':
    main()

