Weekly Challenge X: Template

Solution written up in advance here