#K12826. Important Messages Filter

    ID: 23777 Type: Default 1000ms 256MiB

Important Messages Filter

Important Messages Filter

You are given a list of messages and a keyword. Your task is to output all messages that contain the given keyword. The comparison is case-insensitive. If the keyword is an empty string, then all the messages should be printed.

The input is read from stdin and the output should be printed to stdout. Make sure that your solution correctly handles cases where the keyword does not appear in any message as well as cases with different cases (uppercase/lowercase).

inputFormat

The first line contains an integer n, representing the number of messages. The following n lines each contain a message (which may include spaces and punctuation). The last line contains the keyword string. Note that the keyword can be an empty string.

outputFormat

Print each message that contains the keyword (case-insensitive) on a separate line, in the same order as they appear in the input. If the keyword is an empty string, print all messages. If no message matches the keyword, do not print anything.## sample

4
Don't forget the meeting tomorrow
Lunch at noon?
Project deadline is next week
Meeting notes have been shared
meeting
Don't forget the meeting tomorrow

Meeting notes have been shared

</p>