print(sorted(input().split(), key=lambda str: str[1]))