Pretty much brute forcing #5.

Haven't checked solution yet.