<gh_stars>1-10
first, last = input(), input()
print(f"{last}, {first}" if last > "Hopper" else f"{first} {last}")
first, last = input(), input()
print(f"{last}, {first}" if last > "Hopper" else f"{first} {last}")