from math import cos, sin, pi

def show(p):
    print(f'{p.real:.08} {p.imag:.08}')

def rotate(p, theta):
    return p*complex(cos(theta), sin(theta))

def go(n, p1, p2):
    if n == 0:
        return
    s = (p2 - p1)/3 + p1
    t = 2*s - p1
    u = rotate(t - s, pi/3) + s
    go(n - 1, p1, s)
    show(s)
    go(n - 1, s, u)
    show(u)
    go(n - 1, u, t)
    show(t)
    go(n - 1, t, p2)


p1 = complex(0, 0)
p2 = complex(100, 0)
show(p1)
go(int(input()), p1, p2)
show(p2) from math import cos, sin, pi def show(p):
    print(f'{p.real:.08} {p.imag:.08}') show print(f'{p.real:.08} {p.imag:.08}') print f'{p.real:.08} {p.imag:.08}' p p def rotate(p, theta):
    return p*complex(cos(theta), sin(theta)) rotate return p*complex(cos(theta), sin(theta)) p*complex(cos(theta), sin(theta)) p complex(cos(theta), sin(theta)) complex cos(theta) cos theta sin(theta) sin theta p p theta theta def go(n, p1, p2):
    if n == 0:
        return
    s = (p2 - p1)/3 + p1
    t = 2*s - p1
    u = rotate(t - s, pi/3) + s
    go(n - 1, p1, s)
    show(s)
    go(n - 1, s, u)
    show(u)
    go(n - 1, u, t)
    show(t)
    go(n - 1, t, p2) go if n == 0:
        return
     n == 0 n 0 return s = (p2 - p1)/3 + p1 s (p2 - p1)/3 + p1 (p2 - p1)/3 p2 - p1 p2 p1 3 p1 t = 2*s - p1 t 2*s - p1 2*s 2 s p1 u = rotate(t - s, pi/3) + s u rotate(t - s, pi/3) + s rotate(t - s, pi/3) rotate t - s t s pi/3 pi 3 s go(n - 1, p1, s) go n - 1 n 1 p1 s show(s) show s go(n - 1, s, u) go n - 1 n 1 s u show(u) show u go(n - 1, u, t) go n - 1 n 1 u t show(t) show t go(n - 1, t, p2) go n - 1 n 1 t p2 n n p1 p1 p2 p2 p1 = complex(0, 0) p1 complex(0, 0) complex 0 0 p2 = complex(100, 0) p2 complex(100, 0) complex 100 0 show(p1) show p1 go(int(input()), p1, p2) go int(input()) int input() input p1 p2 show(p2) show p2 p2 = complex(100, 0) complex(100, 0) p2 def show(p):
    print(f'{p.real:.08} {p.imag:.08}') def show(p):
    print(f'{p.real:.08} {p.imag:.08}') show p1 = complex(0, 0) complex(0, 0) p1 def rotate(p, theta):
    return p*complex(cos(theta), sin(theta)) def rotate(p, theta):
    return p*complex(cos(theta), sin(theta)) rotate def go(n, p1, p2):
    if n == 0:
        return
    s = (p2 - p1)/3 + p1
    t = 2*s - p1
    u = rotate(t - s, pi/3) + s
    go(n - 1, p1, s)
    show(s)
    go(n - 1, s, u)
    show(u)
    go(n - 1, u, t)
    show(t)
    go(n - 1, t, p2) def go(n, p1, p2):
    if n == 0:
        return
    s = (p2 - p1)/3 + p1
    t = 2*s - p1
    u = rotate(t - s, pi/3) + s
    go(n - 1, p1, s)
    show(s)
    go(n - 1, s, u)
    show(u)
    go(n - 1, u, t)
    show(t)
    go(n - 1, t, p2) go
from math import cos, sin, pi

def show(p):
    print(f'{p.real:.08} {p.imag:.08}')

def rotate(p, theta):
    return p*complex(cos(theta), sin(theta))

def go(n, p1, p2):
    if n == 0:
        return
    s = (p2 - p1)/3 + p1
    t = 2*s - p1
    u = rotate(t - s, pi/3) + s
    go(n - 1, p1, s)
    show(s)
    go(n - 1, s, u)
    show(u)
    go(n - 1, u, t)
    show(t)
    go(n - 1, t, p2)


p1 = complex(0, 0)
p2 = complex(100, 0)
show(p1)
go(int(input()), p1, p2)
show(p2)
