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
	{
		List<String> strs = Arrays.asList("ABC/1111111031111111/0318*12345678", 
				"ABC/1111111031111111/1120*12345678");
		String pattern = "(/\\d{12,19}/)(?:0[1-9]|1[0-2])\\d{2}(\\*)";
		for (String str : strs)
			System.out.println(str + " => " + str.replaceAll(pattern, "$11222$2"));

	}
}