MegaFirm Inc. has created a set of patterns to aid its telephone help-desk operators in responding to customers. A pattern is a phrase consisting of words and placeholders. A word is simply a string of letters. A placeholder is a word enclosed in angle brackets (that is < ... >). A phrase matches a pattern if each placeholder in the pattern can be systematically replaced by a word so as to make the pattern and phrase equal. By "systematically replaced" we mean that all placeholders enclosing the same word are replaced by the same word.
For example, the phrase
to be or not to be
matches the pattern
<foo> be <bar> not <foo> <baf>
because we can replace <foo> by to, <bar> by or, and <baf> by be.
Given two patterns, you are to find a phrase that matches both.