After more than 3 years of complete dominance, MineCraft Awesome Parodys has a new competitor:
- Each line must have the word
mineand the word
craftat least once at some point.
- The first occurrence of
minemust come before the first occurrence of
craftin each line.
- The number of non
craftwords should not exceed the number of times
The first line contains an integer , the number of lines in the Minecraft parody.
The next lines each contain a line from the minecraft parody. Each line will consist only of lowercase letters and space and will not exceed characters in length.
Note: For the purposes of this problem a word is defined as a collection of letters separated from other words by a space.
A single line containing either
PROFIT if the song is a Minecraft parody, or
Sample Input 1
2 welcome to my mine we are mining diamonds
Sample Output 1
Sample Input 2
Sample Output 2
Sample Input 3
2 my mine craft mine yes i mine craft
Sample Output 3