  We first rigourously establish, for any N, that the toroidal modular
invariant partition functions for the (not necessarily unitary) W_N(p,q)
minimal models biject onto a well-defined subset of those of the SU(N)xSU(N)
Wess-Zumino-Witten theories at level (p-N,q-N). This permits considerable
simplifications to the proof of the Cappelli-Itzykson-Zuber classification of
Virasoro minimal models. More important, we obtain from this the complete
classification of all modular invariants for the W_3(p,q) minimal models. All
should be realised by rational conformal field theories. Previously, only those
for the unitary models, i.e. W_3(p,p+1), were classified. For all N our
correspondence yields for free an extensive list of W_N(p,q) modular
invariants. The W_3 modular invariants, like the Virasoro minimal models, all
factorise into SU(3) modular invariants, but this fails in general for larger
N. We also classify the SU(3)xSU(3) modular invariants, and find there a new
infinite series of exceptionals.
