for s in raw_input().split(): t=s.lower() if list(t)==sorted(t):print s,