#C6982. Abbreviation Autocorrect
Abbreviation Autocorrect
Abbreviation Autocorrect
You are given a list of abbreviations along with their corresponding full forms as well as several sentences. Your task is to replace every occurrence of an abbreviation with its full form in each sentence. The abbreviations will only be replaced when they match exactly a word in the sentence.
Input/Output: Read the input from standard input and write the output to standard output. Each sentence's words are separated by spaces. If a sentence does not contain any abbreviation from the list, it should be output unchanged.
inputFormat
The input contains several parts:
- An integer n representing the number of abbreviations.
- n lines follow, each line contains an abbreviation and its full form separated by a space. Note that the full form might contain spaces.
- An integer m representing the number of sentences.
- m subsequent lines, each representing a sentence.
outputFormat
Output m lines. Each line should contain a sentence after converting the abbreviations to their full forms, preserving the order of words.
## sample1
brb be right back
1
please brb
please be right back