Solution to #51.