import java.util.*;
import java.lang.*;

class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String str = "test \"abc\" ... \"def\" end";
		System.out.println("before: " + str);
		str = str.replaceAll("\"","\\\\\"");
		System.out.println("after: " + str);
	}
}