Transform those strings |
Given below is a set of rules that can be used to transform one string into another:
Sets are always given as a range, i.e. {`a' - `c'} is the set with the characters {`a',`b',`c'}
Note that several transformations may exist, your program only needs to find one. It is also possible that the first string cannot be transformed into the second. In this case, your program should simply output the word ``no''
If there are more than one test cases, it must be a blank line between two consecutive, both in input and output files.
thinner rih a x
6: thinner -> rhinner 5: rhinner -> rinner 7: rinner -> rinnhr 5: rinnhr -> rinhr 5: rinhr -> rihr 5: rihr -> rih no