Shorten problem 56's solution