import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.regex.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		String fileText = "_test_";
        String pattern = "test";
        Pattern r = Pattern.compile(pattern);
        Matcher m = r.matcher(fileText);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            m.appendReplacement(sb, repeat("*", m.group(0).length()));
        }
        m.appendTail(sb); // append the rest of the contents
        System.out.println(sb);
	}
	public static String repeat(String s, int n) {
	    if(s == null) {
	        return null;
    	}
    	final StringBuilder sb = new StringBuilder(s.length() * n);
    	for(int i = 0; i < n; i++) {
        	sb.append(s);
    	}
    	return sb.toString();
	}
}