Bacteria solutions

Bacteria was solved using PHP by 3 contestants. Solution sizes: average 1240 bytes (shortest: 901; longest: 1898).