arr = list(map(int, input().split())) max_el, min_el = max(arr), str(min(arr)) print(" ".join(min_el if i == max_el else str(i) for i in arr))