import re
text = "upi xxxxxxxxxx manoj jayant xxx xxxxxxx532kvblhii"
print( " ".join([x for x in text.split() if x != len(x) * x[0] ]) )
print( re.sub(r'\s*\bx+\b', '', text).lstrip() )