a, b, c = map(str, input().split()) a_list = [a,b,c] index_ = a_list.index("?") del a_list[index] new_list = [int(i) for i in a_list] max_number = max(new_list) min_number = min(new_list) if max_number - min_number == 2: print((max_number+minnumber)/2) else: print(max_number+1,min_number-1)