Solution by Ailbhe Tweedie
