def sorted_recursive(arg):
    try:
        return sorted((sorted_recursive(x) for x in arg))
    except TypeError:
        return arg
def sorted_recursive(arg):
    try:
        return sorted((sorted_recursive(x) for x in arg))
    except TypeError:
        return arg