from math import cos, sin, pi


def make_koch_curve(N, n1, n2):
    s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3)
    t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3)
    u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1])
    if N == 0:
        return
    make_koch_curve(N-1, n1, s)
    print(*s)
    make_koch_curve(N-1, s, u)
    print(*u)
    make_koch_curve(N-1, u, t)
    print(*t)
    make_koch_curve(N-1, t, n2)


def main():
    N = int(input())
    n1 = (0., 0.)
    n2 = (100., 0.)
    print(*n1)
    make_koch_curve(N, n1, n2)
    print(*n2)


if __name__ == '__main__':
    main()
 from math import cos, sin, pi def make_koch_curve(N, n1, n2):
    s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3)
    t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3)
    u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1])
    if N == 0:
        return
    make_koch_curve(N-1, n1, s)
    print(*s)
    make_koch_curve(N-1, s, u)
    print(*u)
    make_koch_curve(N-1, u, t)
    print(*t)
    make_koch_curve(N-1, t, n2) make_koch_curve s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3) s ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3) (2 * n1[0] + n2[0]) / 3 2 * n1[0] + n2[0] 2 * n1[0] 2 n1[0] n1 0 n2[0] n2 0 3 (2 * n1[1] + n2[1]) / 3 2 * n1[1] + n2[1] 2 * n1[1] 2 n1[1] n1 1 n2[1] n2 1 3 t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3) t ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3) (n1[0] + 2 * n2[0]) / 3 n1[0] + 2 * n2[0] n1[0] n1 0 2 * n2[0] 2 n2[0] n2 0 3 (n1[1] + 2 * n2[1]) / 3 n1[1] + 2 * n2[1] n1[1] n1 1 2 * n2[1] 2 n2[1] n2 1 3 u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1]) u ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1]) (t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0] (t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) (t[0] - s[0])*cos(pi/3) t[0] - s[0] t[0] t 0 s[0] s 0 cos(pi/3) cos pi/3 pi 3 (t[1] - s[1])*sin(pi/3) t[1] - s[1] t[1] t 1 s[1] s 1 sin(pi/3) sin pi/3 pi 3 s[0] s 0 (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1] (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) (t[0] - s[0])*sin(pi/3) t[0] - s[0] t[0] t 0 s[0] s 0 sin(pi/3) sin pi/3 pi 3 (t[1] - s[1])*cos(pi/3) t[1] - s[1] t[1] t 1 s[1] s 1 cos(pi/3) cos pi/3 pi 3 s[1] s 1 if N == 0:
        return
     N == 0 N 0 return make_koch_curve(N-1, n1, s) make_koch_curve N-1 N 1 n1 s print(*s) print *s s make_koch_curve(N-1, s, u) make_koch_curve N-1 N 1 s u print(*u) print *u u make_koch_curve(N-1, u, t) make_koch_curve N-1 N 1 u t print(*t) print *t t make_koch_curve(N-1, t, n2) make_koch_curve N-1 N 1 t n2 N N n1 n1 n2 n2 def main():
    N = int(input())
    n1 = (0., 0.)
    n2 = (100., 0.)
    print(*n1)
    make_koch_curve(N, n1, n2)
    print(*n2) main N = int(input()) N int(input()) int input() input n1 = (0., 0.) n1 (0., 0.) 0. 0. n2 = (100., 0.) n2 (100., 0.) 100. 0. print(*n1) print *n1 n1 make_koch_curve(N, n1, n2) make_koch_curve N n1 n2 print(*n2) print *n2 n2 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    n1 = (0., 0.)
    n2 = (100., 0.)
    print(*n1)
    make_koch_curve(N, n1, n2)
    print(*n2) def main():
    N = int(input())
    n1 = (0., 0.)
    n2 = (100., 0.)
    print(*n1)
    make_koch_curve(N, n1, n2)
    print(*n2) main def make_koch_curve(N, n1, n2):
    s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3)
    t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3)
    u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1])
    if N == 0:
        return
    make_koch_curve(N-1, n1, s)
    print(*s)
    make_koch_curve(N-1, s, u)
    print(*u)
    make_koch_curve(N-1, u, t)
    print(*t)
    make_koch_curve(N-1, t, n2) def make_koch_curve(N, n1, n2):
    s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3)
    t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3)
    u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1])
    if N == 0:
        return
    make_koch_curve(N-1, n1, s)
    print(*s)
    make_koch_curve(N-1, s, u)
    print(*u)
    make_koch_curve(N-1, u, t)
    print(*t)
    make_koch_curve(N-1, t, n2) make_koch_curve
from math import cos, sin, pi


def make_koch_curve(N, n1, n2):
    s = ((2 * n1[0] + n2[0]) / 3, (2 * n1[1] + n2[1]) / 3)
    t = ((n1[0] + 2 * n2[0]) / 3, (n1[1] + 2 * n2[1]) / 3)
    u = ((t[0] - s[0])*cos(pi/3) - (t[1] - s[1])*sin(pi/3) + s[0],
         (t[0] - s[0])*sin(pi/3) + (t[1] - s[1])*cos(pi/3) + s[1])
    if N == 0:
        return
    make_koch_curve(N-1, n1, s)
    print(*s)
    make_koch_curve(N-1, s, u)
    print(*u)
    make_koch_curve(N-1, u, t)
    print(*t)
    make_koch_curve(N-1, t, n2)


def main():
    N = int(input())
    n1 = (0., 0.)
    n2 = (100., 0.)
    print(*n1)
    make_koch_curve(N, n1, n2)
    print(*n2)


if __name__ == '__main__':
    main()

