#C96. Filter Strings by Suffix

    ID: 53710 Type: Default 1000ms 256MiB

Filter Strings by Suffix

Filter Strings by Suffix

You are given a list of strings and a suffix string. Your task is to filter out and print only those strings that end with the given suffix.

The input starts with an integer n representing the number of strings, followed by n lines each containing a string. The last line of input contains the suffix string.

If a string ends with the given suffix, it should be included in the output. If no string matches the criteria, print an empty line.

Example:

Input:
4
hello
world
hold
cold
ld

Output: world hold cold

</p>

inputFormat

The first line contains an integer n, the number of strings.

The next n lines each contain a single string.

The last line contains the suffix string to filter by.

outputFormat

Print one line containing the filtered strings separated by a single space. If no string ends with the given suffix, print an empty line.

## sample
4
hello
world
hold
cold
ld
world hold cold