#P7008. What Does The Fox Say?

    ID: 20215 Type: Default 1000ms 256MiB

What Does The Fox Say?

What Does The Fox Say?

You have ventured into a forest with a digital audio recorder to solve the ancient mystery: the sound that the fox makes. The forest is filled with a variety of animal sounds; fortunately, you know exactly what sounds other animals produce. Any sound on the recording that does not match a known animal sound must have been made by the fox. Your task is to filter out known animal sounds from the recording and output the remaining sounds in the order they appear.

The input begins with a list of recorded sounds separated by spaces. This is followed by several lines, each indicating a known animal sound in the format: <animal> goes <sound>. The list of known animal sounds is terminated by the line "what does the fox say?". Your program should output the unidentified sounds (i.e. the fox's sounds) separated by spaces.

All formulas or technical representations should use LaTeX format. For example, the processing can be seen as removing elements from the set \( S \) (recording sounds) that are present in the set \( K \) (known animal sounds), then output the remaining elements.

inputFormat

The input is structured as follows:

  • The first line contains the recorded sounds, separated by spaces.
  • Each subsequent line (until the termination line) provides a known animal sound with the format: <animal> goes <sound>.
  • The list of known sounds is terminated by a line that exactly contains: "what does the fox say?"

outputFormat

Output the sounds that do not match any known animal sounds in the order they appear in the recording. The sounds should be separated by a single space.

sample

woof meow tweet buzz
Dog goes woof
Cat goes meow
what does the fox say?
tweet buzz