Modification of solitary waves by third-harmonic generation.