For each dialogue, your program must output the line Dialogue #D:, where D is the sequence number of dialogue, starting with 1. Then print exactly three lines for every question: the first line repeats the question, the second line contains the answer, and the third line is empty. Print nothing for statements. After each dialogue, print the same line with an exclamation mark that was in the input. Then print one extra empty line. Empty line contains a new-line character only.
The answer must be properly formated to be accepted by a TTS module. Only the statements appearing in the input before the answer are used for the corresponding reply. If there is any contradiction among statements, the reply is always I am abroad.. If the question and statements consider the special subject "you", it must be replaced with "I" in the answer. If the question considers special subject "I", it must be replaced with "you" in the answer. The verb must always match the subject of the sentence. The exact form of the correct answer depends on the type of question.
1. does subject predicate [object] ?
If there is any positive statement about the mentioned subject (or generic subject "everybody"), predicate and object, the answer is:
yes, ~ subject ~ predicate[s] [ ~ object] .
If there is any negative statement about the mentioned subject (or generic subject "nobody"), predicate and object, the answer is:
no, ~ subject ~ don't|doesn't ~ predicate [ ~ object] .
Otherwise, the answer is: maybe.
Subject in the answer is always the same subject as the subject of the question.
2. who predicates [object] ?
If there is a positive statement considering any subject, the specified predicate and object, the answer is:
subject ~ predicate[s] [ ~ object] .
If two or more subjects match the activity, replace the subject in the answer with enumeration of all such subjects, in the same order as the corresponding statements have appeared in the input. Subjects are separated with comma and space, last two subjects are separated with the word "and". If "everybody" belongs to the group of enumerated subjects, do not enumerate subjects, and print "everybody" only. If the enumeration contains at least two subjects, the predicate matches the plural subject (i.e. verb is without trailing "s"), otherwise it matches the only subject.
subject1 , ~ subject2 ~ and ~ subject3 predicate [ ~ object] .
If there is a negative statement considering the generic subject "nobody", the specified predicate and object, the answer is:
nobody ~ predicates [ ~ object] .
Otherwise, the answer is: I don't know.
3. what does subject do ?
If there are one or more sentences (both positive and negative) considering the specified subject (or a generic subject "everybody" or "nobody"), all verbs and objects from such sentences must be included in a reply in the same order as the corresponding sentences have appeared in the input. No verb-object pair can be included more than once (the eventual second appearance must be skipped). The verb-object pairs are separated by a comma followed by a space, the last verb is separated by a comma and the word "and". Please note the comma is printed here although there was no comma when separating the subjects in the previous type of answer (see above). The negative answers have the same form as the statements, that means the verb "don't" or "doesn't" is used:
subject [ ~ don't|doesn't] ~ predicate1[s] [ ~ object1] ,
[ ~ don't|doesn't] ~ predicate2[s] [ ~ object2] ,
~ and [ ~ don't|doesn't] ~ predicate3[s] [ ~ object3] .
subject [ ~ don't|doesn't] ~ predicate1[s] [ ~ object1] ,
~ and [ ~ don't|doesn't] ~ predicate2[s] [ ~ object2] .
subject [ ~ don't|doesn't] ~ predicate[s] [ ~ object] .
Otherwise, the answer is: I don't know.