#C14593. Filter Strings with Substring

    ID: 44259 Type: Default 1000ms 256MiB

Filter Strings with Substring

Filter Strings with Substring

You are given a target substring and a list of strings. Your task is to select and output all strings from the list that contain the target substring, ignoring case.

Formally, for each string \( s \) in the list and a given target \( T \), output \( s \) if and only if the condition \[ \text{lower}(T) \in \text{lower}(s) \] holds. This problem tests your ability to work with string filtering and case-insensitive comparison.

inputFormat

The input is provided via stdin in the following format:

  1. The first line contains the target substring (a string).
  2. The second line contains an integer \( n \) representing the number of strings in the list.
  3. The following \( n \) lines each contain a non-empty string.

outputFormat

Output all strings (in their original order) that contain the target substring (ignoring case), each on a separate line. If none of the strings match, output nothing.

## sample
test
0