l=map(complex,[0,1e2])
for _ in range(input()):
    t,l=l,[0]
    for i,j in zip(t[:-1],t[1:]):
        d=(j-i)/3
        l.extend((i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j))
for i in l:
    print i.real,i.imag l=map(complex,[0,1e2]) l map(complex,[0,1e2]) map complex [0,1e2] 0 1e2 for _ in range(input()):
    t,l=l,[0]
    for i,j in zip(t[:-1],t[1:]):
        d=(j-i)/3
        l.extend((i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j)) _ range(input()) range input() input t,l=l,[0] t l l [0] 0 for i,j in zip(t[:-1],t[1:]):
        d=(j-i)/3
        l.extend((i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j)) i j zip(t[:-1],t[1:]) zip t[:-1] t :-1 -1 t[1:] t 1: 1 d=(j-i)/3 d (j-i)/3 j-i j i 3 l.extend((i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j)) l.extend l extend (i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j) i+d i d i+d+d*complex(1,3**0.5)/2 i+d i d d*complex(1,3**0.5)/2 d*complex(1,3**0.5) d complex(1,3**0.5) complex 1 3**0.5 3 0.5 2 i+d*2 i d*2 d 2 j for i in l:
    print i.real,i.imag i l print i.real i real i.imag i imag l=l,[0] [0] l t,l=l,[0] l t d=(j-i)/3 (j-i)/3 d l=map(complex,[0,1e2]) map(complex,[0,1e2]) l
l=map(complex,[0,1e2])
for _ in range(input()):
    t,l=l,[0]
    for i,j in zip(t[:-1],t[1:]):
        d=(j-i)/3
        l.extend((i+d,i+d+d*complex(1,3**0.5)/2,i+d*2,j))
for i in l:
    print i.real,i.imag