from io import StringIO


def read_output_val(f: StringIO) -> str:
    """
    Retrieves the content of StringIO object without trailing whitespace.
    Args:
        f: StringIO object
    Returns:
        String content of `f` StringIO object with trailing whitespace removed.
    """
    return f.getvalue().rstrip()