Template and solution codes.