import java.util.regex.*;

public class Main {
  public static void main(String[] args) {
    Pattern replace = Pattern.compile("^[A-Za-z][\\d]{4}$");
    Matcher matcher1 = replace.matcher("A1234");
    System.out.println("Output of A1234 = " + matcher1.replaceAll("ITS REPLACED"));
    Matcher matcher2 = replace.matcher("F87652");
    System.out.println("Output of F87652 = " + matcher2.replaceAll("ITS REPLACED"));
  }
} 