With the introduction of Large Language Models (LLMs), Alex began to actively use them for various purposes: to explain an incomprehensible topic on the subject, make a training plan, and even write a birthday greeting to his friends. To use LLM, you need to write a lead-in called prompt. The aim of the prompt is to explain to the model what is to be done and what is expected as a response. Thus the whole question cannot consist of a prompt only. The prompt usually looks like this:
You work as a proofreader for educational books. Rewrite the following text, correcting grammatical, punctuation, and semantic errors.
Alex's friends also began using LLMs and actively sharing their generation results. Alex decided to make a collection of successful prompts to use them more actively later. A prompt is considered successful if the result of most generations with this prompt is considered successful.
Alex has a set of questions that he and his friends have asked LLM. He came up with the following algorithm to find all the prompts from a set of questions:
At the end of this algorithm, we obtain the set of all prompts for the questions.
Help Alex: find all the successful prompts from the questions Alex and his friends asked LLM.
The first line of the input contains a single non-negative integer $$$N$$$ — the number of questions ($$$1 \le N \le 1000$$$).
The second line of the input data contains $$$N$$$ numbers; the $$$i$$$-th number is 0 if the generation result for the $$$i$$$-th question was unsuccessful and 1 if the generation result for the $$$i$$$th question was successful.
The following $$$N$$$ non-empty lines contain questions — sequences of words separated by a space. A word is a sequence of characters of the Latin alphabet, which may end with a punctuation mark. The length of the line does not exceed 10000, and the number of words in the line does not exceed 1000.
Print all the successful prompts that can be obtained from the questions on separate lines in any order.
70 1 1 1 1 0 1Create text about my momSummarize Crime and PunishmentCreate text about my friendCreate text about my bossSummarize calculus bookSummarize Harry PotterCreate text about my dog
Create text about my Summarize
| Name |
|---|


