Line censorship: substring replacement
Java
Easy
strings
Task «Line censorship: substring replacement»
Write a program that takes a string and two words. It is necessary to replace all occurrences of the first word in the input string with the second word. Character case is taken into account. It is guaranteed that the length of the string does not exceed 1000 characters, and the lengths of the words do not exceed 100 characters.
Input Format
In the first line, the original string is entered. In the second line, the word to be replaced. In the third line, the word to replace it with.
Output Format
Output one line — the result of the replacement.
Examples
Example 1
INPUT
4
-1 -2 -3 -4
OUTPUT
main.java