d=[0j,100+0j]
for _ in[0]*int(input()):
 p=[d[0]]
 for i in range(len(d)-1):
  a,b=d[i],d[i+1]
  r=(b-a)/3
  p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b]
 d=p
for e in d:print(e.real,e.imag) d=[0j,100+0j] d [0j,100+0j] 0j 100+0j 100 0j for _ in[0]*int(input()):
 p=[d[0]]
 for i in range(len(d)-1):
  a,b=d[i],d[i+1]
  r=(b-a)/3
  p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b]
 d=p _ [0]*int(input()) [0] 0 int(input()) int input() input p=[d[0]] p [d[0]] d[0] d 0 for i in range(len(d)-1):
  a,b=d[i],d[i+1]
  r=(b-a)/3
  p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b]
  i range(len(d)-1) range len(d)-1 len(d) len d 1 a,b=d[i],d[i+1] a d[i] d i b d[i+1] d i+1 i 1 r=(b-a)/3 r (b-a)/3 b-a b a 3 p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b] p [a+r,a+r+r*(1+3**.5*1j)/2,b-r,b] a+r a r a+r+r*(1+3**.5*1j)/2 a+r a r r*(1+3**.5*1j)/2 r*(1+3**.5*1j) r 1+3**.5*1j 1 3**.5*1j 3**.5 3 .5 1j 2 b-r b r b d=p d p for e in d:print(e.real,e.imag) e d a,b=d[i],d[i+1] d[i] a d=[0j,100+0j] [0j,100+0j] d b=d[i],d[i+1] d[i+1] b p=[d[0]] [d[0]] p d=p p d p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b] [a+r,a+r+r*(1+3**.5*1j)/2,b-r,b] p r=(b-a)/3 (b-a)/3 r
d=[0j,100+0j]
for _ in[0]*int(input()):
 p=[d[0]]
 for i in range(len(d)-1):
  a,b=d[i],d[i+1]
  r=(b-a)/3
  p+=[a+r,a+r+r*(1+3**.5*1j)/2,b-r,b]
 d=p
for e in d:print(e.real,e.imag)
