  The model of laminated wave turbulence puts forth a novel computational
problem - construction of fast algorithms for finding exact solutions of
Diophantine equations in integers of order $10^{12}$ and more. The equations to
be solved in integers are resonant conditions for nonlinearly interacting waves
and their form is defined by the wave dispersion. It is established that for
the most common dispersion as an arbitrary function of a wave-vector length two
different generic algorithms are necessary: (1) one-class-case algorithm for
waves interacting through scales, and (2) two-class-case algorithm for waves
interacting through phases. In our previous paper we described the
one-class-case generic algorithm and in our present paper we present the
two-class-case generic algorithm.
