from functools import reduce
import math

orientation = math.cos(math.pi/3) + 1j * math.sin(math.pi/3)


def main():
    n = int(input())
    results = [(0.0, 0.0), (100.0, 0.0)]
    results = koch_curve(results, 0, n)
    for r in results:
        print(r[0], r[1])


def f(a, b):
    c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3)
    d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3)
    vec = d[0] + d[1]*1j - (c[0] + 1j*c[1])
    e = vec * orientation
    e += (c[0] + 1j*c[1])
    e = (e.real, e.imag)
    return [a, c, e, d]


def koch_curve(lst, i, maximum):
    if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum)


if __name__ == '__main__':
    main()
 from functools import reduce import math math orientation = math.cos(math.pi/3) + 1j * math.sin(math.pi/3) orientation math.cos(math.pi/3) + 1j * math.sin(math.pi/3) math.cos(math.pi/3) math.cos math cos math.pi/3 math.pi math pi 3 1j * math.sin(math.pi/3) 1j math.sin(math.pi/3) math.sin math sin math.pi/3 math.pi math pi 3 def main():
    n = int(input())
    results = [(0.0, 0.0), (100.0, 0.0)]
    results = koch_curve(results, 0, n)
    for r in results:
        print(r[0], r[1]) main n = int(input()) n int(input()) int input() input results = [(0.0, 0.0), (100.0, 0.0)] results [(0.0, 0.0), (100.0, 0.0)] (0.0, 0.0) 0.0 0.0 (100.0, 0.0) 100.0 0.0 results = koch_curve(results, 0, n) results koch_curve(results, 0, n) koch_curve results 0 n for r in results:
        print(r[0], r[1]) r results print(r[0], r[1]) print r[0] r 0 r[1] r 1 def f(a, b):
    c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3)
    d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3)
    vec = d[0] + d[1]*1j - (c[0] + 1j*c[1])
    e = vec * orientation
    e += (c[0] + 1j*c[1])
    e = (e.real, e.imag)
    return [a, c, e, d] f c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3) c ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3) (2*a[0]+b[0])/3 2*a[0]+b[0] 2*a[0] 2 a[0] a 0 b[0] b 0 3 (2*a[1]+b[1])/3 2*a[1]+b[1] 2*a[1] 2 a[1] a 1 b[1] b 1 3 d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3) d ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3) (a[0]+2*b[0])/3 a[0]+2*b[0] a[0] a 0 2*b[0] 2 b[0] b 0 3 (a[1]+2*b[1])/3 a[1]+2*b[1] a[1] a 1 2*b[1] 2 b[1] b 1 3 vec = d[0] + d[1]*1j - (c[0] + 1j*c[1]) vec d[0] + d[1]*1j - (c[0] + 1j*c[1]) d[0] + d[1]*1j d[0] d 0 d[1]*1j d[1] d 1 1j c[0] + 1j*c[1] c[0] c 0 1j*c[1] 1j c[1] c 1 e = vec * orientation e vec * orientation vec orientation e += (c[0] + 1j*c[1]) e c[0] + 1j*c[1] c[0] c 0 1j*c[1] 1j c[1] c 1 e = (e.real, e.imag) e (e.real, e.imag) e.real e real e.imag e imag return [a, c, e, d] [a, c, e, d] a c e d a a b b def koch_curve(lst, i, maximum):
    if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum) koch_curve if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum) i == maximum i maximum return lst lst results = [] results [] l = len(lst) l len(lst) len lst for j in range(l-1):
            results += f(lst[j], lst[j+1])
         j range(l-1) range l-1 l 1 results += f(lst[j], lst[j+1]) results f(lst[j], lst[j+1]) f lst[j] lst j lst[j+1] lst j+1 j 1 results += [lst[j+1]] results [lst[j+1]] lst[j+1] lst j+1 j 1 return koch_curve(results, i+1, maximum) koch_curve(results, i+1, maximum) koch_curve results i+1 i 1 maximum lst lst i i maximum maximum if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main orientation = math.cos(math.pi/3) + 1j * math.sin(math.pi/3) math.cos(math.pi/3) + 1j * math.sin(math.pi/3) orientation def main():
    n = int(input())
    results = [(0.0, 0.0), (100.0, 0.0)]
    results = koch_curve(results, 0, n)
    for r in results:
        print(r[0], r[1]) def main():
    n = int(input())
    results = [(0.0, 0.0), (100.0, 0.0)]
    results = koch_curve(results, 0, n)
    for r in results:
        print(r[0], r[1]) main def f(a, b):
    c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3)
    d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3)
    vec = d[0] + d[1]*1j - (c[0] + 1j*c[1])
    e = vec * orientation
    e += (c[0] + 1j*c[1])
    e = (e.real, e.imag)
    return [a, c, e, d] def f(a, b):
    c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3)
    d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3)
    vec = d[0] + d[1]*1j - (c[0] + 1j*c[1])
    e = vec * orientation
    e += (c[0] + 1j*c[1])
    e = (e.real, e.imag)
    return [a, c, e, d] f def koch_curve(lst, i, maximum):
    if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum) def koch_curve(lst, i, maximum):
    if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum) koch_curve
from functools import reduce
import math

orientation = math.cos(math.pi/3) + 1j * math.sin(math.pi/3)


def main():
    n = int(input())
    results = [(0.0, 0.0), (100.0, 0.0)]
    results = koch_curve(results, 0, n)
    for r in results:
        print(r[0], r[1])


def f(a, b):
    c = ((2*a[0]+b[0])/3, (2*a[1]+b[1])/3)
    d = ((a[0]+2*b[0])/3, (a[1]+2*b[1])/3)
    vec = d[0] + d[1]*1j - (c[0] + 1j*c[1])
    e = vec * orientation
    e += (c[0] + 1j*c[1])
    e = (e.real, e.imag)
    return [a, c, e, d]


def koch_curve(lst, i, maximum):
    if i == maximum:
        return lst
    else:
        results = []
        l = len(lst)
        for j in range(l-1):
            results += f(lst[j], lst[j+1])
        results += [lst[j+1]]
        return koch_curve(results, i+1, maximum)


if __name__ == '__main__':
    main()

