Path integral solubility of a general two-dimensional model