/* package whatever; // don't place package name! */

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

/* 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 input = "Hello world!";
		HashMap<String, String> replacements = new HashMap<String, String>() {{
			put("world", "earth");
		}};
		
		StringBuilder sb = new StringBuilder();
		int start = 0;
		while (start < input.length()) {
			sb.append(input.charAt(start));
			String rep = replacements.get(sb.toString());
			if (rep != null) {
				sb.setLength(sb.length() - rep.length() - 1);
				sb.append(rep);
			}
			start++;
		}
		System.out.println(sb.toString());
	}
}