Romeo and Juilet

The feud between the Montagues and the Capulets was a tragedy for lovers Juliet Capulet and Romeo Montague. Professor Starcrossed has been studying the geneology of these families with a goal to determine if the feud was ever resolved. In her judgement it would be resolved if members of the two families ever married. Prof. *Xd has delved into all sorts of diaries, newspapers and other writings to try to learn the answer to this burning question. Whenever she finds a reference to a person that makes clear they are a Montegue, she enters a line like "M Fredo". Similarly for Capulets and entry like "C Marianne" Whenever she finds a writing that makes plain that two people are of the same family, like "Joe's brother Mark ate fish", she has an entry like "R Joe Mark". She does this whenever she thinks there is some chance the family is one of our feuders. Finally whenever she sees news of a marriage possibly involving a Montegue and/or a Capulet, the entry looks like "M Jane Jack".

By a separate accounting system, Dr. StirCrest avoids ever using the same name for two different people. She refers to Romeo as "Romeo" and Juliet as "Juliet".

From her data (terminated by end of file) determine if the feud is resolved and output "Resolved" or "Not yet" (on one line and the quote marks are not part of your output.

Sample input:

M Marianne
R Joe Fredo
R Juliet Joe
M Fredo Marianne

Sample output:

Resolved