The two-singular-manifold method: I. Modified Korteweg-de Vries and sine-Gordon equations