Problem nr 5.4.4 in all its splendor.