A rather complicated setup, admittedly, but it's super satisfying if you manage to solve it on your own without having it spoiled.