Unreadable Text
InterviewTime limit1sMemory limit1024 MB
Given N topics and a pattern where '*' marks each unreadable letter, list every topic that matches the pattern in input order.
- Level
Easy2 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Problem
The teacher gave Juku an essay as homework. Unfortunately, Juku's handwriting is very bad, and the teacher already has trouble reading the essay topic.
Write a program that determines which topic Juku could have written the essay on.
Input
The first line of the file contains N, the number of topics the teacher gave (). The next N lines each contain one topic. The last line of the file contains the topic Juku chose, where each unreadable letter is replaced by '*'. Each '*' replaces exactly one unreadable letter in the topic Juku wrote. All topics are strings of length 1 to 100 that consist only of lowercase Latin letters ('a' to 'z').
Output
Print the number V of topics that match Juku's essay on the first line. Then print the V topics, in the same order as they appeared in the input.