import cmath

cmp_s = cmath.rect(1/3, 0)
cmp_u = cmath.rect(3**(-1/2), cmath.pi / 6)
cmp_t = cmath.rect(2/3, 0)


def koch_curve(p1: complex, p2: complex, n):
    if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1)


def main():
    n = int(input())
    print('{0:8f} {1:8f}'.format(.0, .0))
    koch_curve(complex(.0, .0), complex(100.0, .0), n)
    print('{0:8f} {1:8f}'.format(100.0, .0))


if __name__ == '__main__':
    main()
 import cmath cmath cmp_s = cmath.rect(1/3, 0) cmp_s cmath.rect(1/3, 0) cmath.rect cmath rect 1/3 1 3 0 cmp_u = cmath.rect(3**(-1/2), cmath.pi / 6) cmp_u cmath.rect(3**(-1/2), cmath.pi / 6) cmath.rect cmath rect 3**(-1/2) 3 -1/2 -1 2 cmath.pi / 6 cmath.pi cmath pi 6 cmp_t = cmath.rect(2/3, 0) cmp_t cmath.rect(2/3, 0) cmath.rect cmath rect 2/3 2 3 0 def koch_curve(p1: complex, p2: complex, n):
    if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1) koch_curve if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1) n != 0 n 0 cmp = p2 - p1 cmp p2 - p1 p2 p1 p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t) for c in (cmp_s, cmp_u, cmp_t) c (cmp_s, cmp_u, cmp_t) cmp_s cmp_u cmp_t for c in (cmp_s, cmp_u, cmp_t) p1 + cmp * c p1 cmp * c cmp c s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)] s [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)] u t koch_curve(p1, s, n-1) koch_curve p1 s n-1 n 1 print('{0:8f} {1:8f}'.format(s.real, s.imag)) print '{0:8f} {1:8f}'.format(s.real, s.imag) '{0:8f} {1:8f}'.format '{0:8f} {1:8f}' format s.real s real s.imag s imag koch_curve(s, u, n-1) koch_curve s u n-1 n 1 print('{0:8f} {1:8f}'.format(u.real, u.imag)) print '{0:8f} {1:8f}'.format(u.real, u.imag) '{0:8f} {1:8f}'.format '{0:8f} {1:8f}' format u.real u real u.imag u imag koch_curve(u, t, n-1) koch_curve u t n-1 n 1 print('{0:8f} {1:8f}'.format(t.real, t.imag)) print '{0:8f} {1:8f}'.format(t.real, t.imag) '{0:8f} {1:8f}'.format '{0:8f} {1:8f}' format t.real t real t.imag t imag koch_curve(t, p2, n-1) koch_curve t p2 n-1 n 1 p1: complex p1 p2: complex p2 n n def main():
    n = int(input())
    print('{0:8f} {1:8f}'.format(.0, .0))
    koch_curve(complex(.0, .0), complex(100.0, .0), n)
    print('{0:8f} {1:8f}'.format(100.0, .0)) main n = int(input()) n int(input()) int input() input print('{0:8f} {1:8f}'.format(.0, .0)) print '{0:8f} {1:8f}'.format(.0, .0) '{0:8f} {1:8f}'.format '{0:8f} {1:8f}' format .0 .0 koch_curve(complex(.0, .0), complex(100.0, .0), n) koch_curve complex(.0, .0) complex .0 .0 complex(100.0, .0) complex 100.0 .0 n print('{0:8f} {1:8f}'.format(100.0, .0)) print '{0:8f} {1:8f}'.format(100.0, .0) '{0:8f} {1:8f}'.format '{0:8f} {1:8f}' format 100.0 .0 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def koch_curve(p1: complex, p2: complex, n):
    if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1) def koch_curve(p1: complex, p2: complex, n):
    if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1) koch_curve cmp_t = cmath.rect(2/3, 0) cmath.rect(2/3, 0) cmp_t cmp_s = cmath.rect(1/3, 0) cmath.rect(1/3, 0) cmp_s cmp_u = cmath.rect(3**(-1/2), cmath.pi / 6) cmath.rect(3**(-1/2), cmath.pi / 6) cmp_u def main():
    n = int(input())
    print('{0:8f} {1:8f}'.format(.0, .0))
    koch_curve(complex(.0, .0), complex(100.0, .0), n)
    print('{0:8f} {1:8f}'.format(100.0, .0)) def main():
    n = int(input())
    print('{0:8f} {1:8f}'.format(.0, .0))
    koch_curve(complex(.0, .0), complex(100.0, .0), n)
    print('{0:8f} {1:8f}'.format(100.0, .0)) main
import cmath

cmp_s = cmath.rect(1/3, 0)
cmp_u = cmath.rect(3**(-1/2), cmath.pi / 6)
cmp_t = cmath.rect(2/3, 0)


def koch_curve(p1: complex, p2: complex, n):
    if n != 0:
        cmp = p2 - p1
        s, u, t = [p1 + cmp * c for c in (cmp_s, cmp_u, cmp_t)]
        koch_curve(p1, s, n-1)
        print('{0:8f} {1:8f}'.format(s.real, s.imag))
        koch_curve(s, u, n-1)
        print('{0:8f} {1:8f}'.format(u.real, u.imag))
        koch_curve(u, t, n-1)
        print('{0:8f} {1:8f}'.format(t.real, t.imag))
        koch_curve(t, p2, n-1)


def main():
    n = int(input())
    print('{0:8f} {1:8f}'.format(.0, .0))
    koch_curve(complex(.0, .0), complex(100.0, .0), n)
    print('{0:8f} {1:8f}'.format(100.0, .0))


if __name__ == '__main__':
    main()

