import List main=interact$unwords.f.sort.words f x=nub x\\(x\\nub x)