import java.util.regex.*;
import java.io.*;

public class Decomment {

	static final Pattern COMMENT1 = Pattern.compile("/\\*.*?\\*/", Pattern.DOTALL);
	static final Pattern COMMENT2 = Pattern.compile("//.*");
	
	public static void main(String[] args) throws IOException {
		for (String name : args) {
			BufferedReader r = new BufferedReader(new FileReader(name));
			FileWriter w = new FileWriter(name + ".out");
			StringBuilder sb = new StringBuilder();
			String line;
			while ((line = r.readLine()) != null) {
				sb.append(line).append(System.getProperty("line.separator"));
			}
			String s1 = COMMENT1.matcher(sb).replaceAll("");
			String result = COMMENT2.matcher(s1).replaceAll("");
			w.write(result);
			w.close();
		}
	}
}