Numerical study of cascaded wavelength conversion in quadratic media