from typing import List


def median_of_three(arr: List[int], lo: int, hi: int) -> int:
    """Get the approximate median of three items in the subarray specified by `lo` and `hi` indices, inclusive.
    Given only one distinct item, return itself.
    Given two distinct items, return either item.
    Given three distinct items, return the one in the middle.
    """
    mid = int(lo / 2 + hi / 2)
    if arr[lo] <= arr[mid] <= arr[hi] or arr[hi] <= arr[mid] <= arr[lo]:
        return arr[mid]
    if arr[mid] <= arr[lo] <= arr[hi] or arr[hi] <= arr[lo] <= arr[mid]:
        return arr[lo]
    return arr[hi]