Fixed generating function for maximum