for x in raw_input().split(): y=x.lower() if list(y)==sorted(y):print x,