eolymp
bolt
Try our new interface for solving problems
Problems

Night at Nicholas

Night at Nicholas

\includegraphics{https://static.e-olymp.com/content/9d/9deb75236267285d28be7cd58c97ec6273af9c05.gif} Here and there was this long-awaited night for all kids. All children impatiently waiting for this moment - when they wake up in the morning, and there, under the pillow, a lot of different gifts and sweets. Many children on the eve of this holiday write letters to St. Nicholas. Someone requested a new toy, some videos, but someone new laptop… Our main hero, Vasilko, without exception, he also wrote a letter. But soon, somehow Vasilko learned about the variety of gifts, which is in St. Nicholas.. Now he wondered what it would receive in the morning, when it consisted of \textbf{M }order of things and he knows that the range is Nicholas \textbf{N} things. \InputFile In the first line is an integer \textbf{N }(N<=100000)\textbf{ }-- the number of items in the assortment of Nicholas, in the next \textbf{N} lines is given a list of things (their names). In the (\textbf{N+2)}-th row contains an integer \textbf{M }(M<=100000) -- number of things that Vasilek wrote in his letter in the next \textbf{M }lines specify a list of things that he wanted to get. The names of things are composed of small Latin letters and the name length does not exceed \textbf{20 }characters. Number of goods of some kind, if it is in the range is not limited. \OutputFile In the first line, print out the number of \textbf{K} (K<=M) -- the number of things that will Vasilek. The following\textbf{K} lines of their enumeration in the order in which they were asked for input.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
3
cola
book
notebook
1
notebook
Output example #1
1
notebook
Author PAWLO1993