
import java.util.Scanner;

public class ReplaceCharacter {
    public static void main(String[] args) {
        Scanner  = new Scanner(System.in);
        String userString = scanner.nextLine();
        String charToReplace = scanner.nextLine();
        String replacementChar = scanner.nextLine();

        if (charToReplace.length() != 1 || replacementChar.length() != 1) {
            System.out.println("Invalid input");
        } else {
            String modifiedString = userString.replace(charToReplace.charAt(0), replacementChar.charAt(0));
            System.out.println(modifiedstring);
        }
    }
}




























































// import java.util.Scanner;

// public class ReplaceCharacter
// {
//     public static void main(String[] args)
//     {
//         Scanner scanner = new Scanner(System.in);
//         String userString = scanner.nextLine();
//         String charToReplace = scanner.nextLine();
//         String replacementChar = scanner.nextLine();
//         if (charToReplace.length() != 1 || replacementChar.length() != 1) 
//         {
//             System.out.println("Invalid input");
//         } 
//         else 
//         {
//             String modifiedString = userString.replace(charToReplace.charAt(0), replacementChar.charAt(0));
//             System.out.println(modifiedString);
//         }

        
//     }
// }