  We present the largest near-infrared (NIR) data sets, $JHKs$, ever collected
for classical Cepheids in the Magellanic Clouds (MCs). We selected fundamental
(FU) and first overtone (FO) pulsators, and found 4150 (2571 FU, 1579 FO)
Cepheids for Small Magellanic Cloud (SMC) and 3042 (1840 FU, 1202 FO) for Large
Magellanic Cloud (LMC). Current sample is 2--3 times larger than any sample
used in previous investigations with NIR photometry. We also discuss optical
$VI$ photometry from OGLE-III. NIR and optical--NIR Period-Wesenheit (PW)
relations are linear over the entire period range ($0.0<\log P_{\rm FU} \le1.65
$) and their slopes are, within the intrinsic dispersions, common between the
MCs. These are consistent with recent results from pulsation models and
observations suggesting that the PW relations are minimally affected by the
metal content. The new FU and FO PW relations were calibrated using a sample of
Galactic Cepheids with distances based on trigonometric parallaxes and Cepheid
pulsation models. By using FU Cepheids we found a true distance moduli of
$18.45\pm0.02{\rm(random)}\pm0.10{\rm(systematic)}$ mag (LMC) and
$18.93\pm0.02{\rm(random)}\pm0.10{\rm(systematic)}$ mag (SMC). These estimates
are the weighted mean over ten PW relations and the systematic errors account
for uncertainties in the zero-point and in the reddening law. We found similar
distances using FO Cepheids
($18.60\pm0.03{\rm(random)}\pm0.10{\rm(systematic)}$ mag [LMC] and
$19.12\pm0.03{\rm(random)}\pm0.10{\rm(systematic)}$ mag [SMC]). These new MC
distances lead to the relative distance, $\Delta\mu=0.48\pm0.03$ mag (FU, $\log
P=1$) and $\Delta\mu=0.52\pm0.03$ mag (FO, $\log P=0.5$),which agrees quite
well with previous estimates based on robust distance indicators.
