eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

XYZX 2009

XYZX 2009

Ліміт часу 2 секунди
Ліміт використання пам'яті 256 MiB

The annual XYZX programming competition is well known for its unusual problem statements. The Technical Coordinator of the competition, also known as Snusmumrik, intentionally leaves some freedom in the problem statements, so that the participants have to guess the missing conditions from the sample tests, from the problem preface or even epigraph, or just invent something themselves. This peculiarity revealed itself in the latest XYZX-2009 competition as well.

Misha is competing in a round of that competition — Quarterfinal of Eniseysk, and he has bumped into that obstacle again: he needs to understand why does his perfectly correct program fail on the sample tests. The statements are in English, and he knows that there is only one false sentence in the whole problem statement. Moreover, he knows a set of rules that enables him to restore the original statement that the author had in mind. It is very simple: the word "not" can be inserted after any of the words "can", "may", "must", "should" in the text; also the word "no" can be inserted after any of the phrases "is", "are". Words "not" and "no" must be inserted exactly as written: "Not", "nO" and other variants are not permitted. The other words mentioned, however, are case insensitive, so you can insert "not" after "Can", and you can insert "no" after "ARE". If there is any article ("a" or "the") after "is" or "are" where you're inserting "no", you must also remove that article.

Misha wants to get the list of all the possible reasons that his program doesn't work on the sample tests. A reason here is a sentence where a negation can be applied. Remember that no two negations can be applied simultaneously, neither in one sentence nor in different sentences.

Вхідні дані

The input file contains the text of the problem statement containing latin letters, single spaces and dots. Every sentence has a dot at the end (which is not considered the part of the last word). Words are separated with a single space. There is no space before any dot. There is exactly one space after each dot unless that dot follows the last sentence; in that case, the dot is followed by a newline, and then the input file ends. When inserting a word "not" or "no" after some word, you must first insert a single space, then the corresponding word immediately. The size of the input file doesn't exceed 1024 bytes.

Вихідні дані

The output file must first contain an integer k on a line by itself — the number of ways the problem statement can be understood differently. Then k lines must follow. Each line should contain one sentence from the initial text with exactly one negation applied. You must list all the possibilities (the lines are wrapped in the sample output just for better visibility; you must output one sentence per line). All the variants of negation must go in the natural order: all the negations that can be inserted in the first sentence, then all the negations that can be inserted in the second sentence, etc. Inside one sentence, first goes the negation that is applied after the first word (if applicable), then the one that is applied after the second word, etc.

You must not change the case of the letters in the words that you copy from the initial sentences. Your words must still be separated with single spaces, and the same rules apply to the dots at the ends of the sentences, as they do for the input sentences.

Приклад

Вхідні дані #1
There is a field with label K on the field. There is a field with label G on the field. You must intersect the rectangle with each of the given rectangles separately. Two different particles can annihilate each other in case of collision. There must be a blank line after each test case output. Two different ways to insert a symbol into the expression are considered the same if the resulting expressions viewed as strings are equal. Misha can find out whether this problem statement can be understood correctly at all.
Вихідні дані #1
9
There is no field with label K on the field.
There is no field with label G on the field.
You must not intersect the rectangle with each of the given rectangles separately.
Two different particles can not annihilate each other in case of collision.
There must not be a blank line after each test case output.
Two different ways to insert a symbol into the expression are no considered the same if the resulting expressions viewed as strings are equal.
Two different ways to insert a symbol into the expression are considered the same if the resulting expressions viewed as strings are no equal.
Misha can not find out whether this problem statement can be understood correctly at all.
Misha can find out whether this problem statement can not be understood correctly at all.
Автор Петро Мітрічев
Джерело Зимова Школа, Харків 2011, День 8