def dict_or_list_2_tuple_2_str(inp):
    """
    dict_or_list_2_tuple_2_str
    Args:
        inp: dict or list of 2-tuple

    Returns:
        formatted string
    """
    if isinstance(inp, dict):
        inp = sorted(list(inp.items()), key=lambda x: x[0])
    else:
        inp = sorted(inp, key=lambda x: x[0])
    out_str = "\n"
    for k, v in inp:
        one_line = "{} ----> {}\n".format(k, v)
        out_str += one_line
    return out_str