def METHOD_NAME(d: dict) -> dict:
    for k, v in d.items():
        assert type(k) == str, 'Non-string key types not allowed.'
        if type(v) == list:
            for i in range(len(v)):
                if isinstance(v[i], dict):
                    v[i] = METHOD_NAME(v[i])
        elif isinstance(v, dict):
            d[k] = METHOD_NAME(v)
    return {k: v for k, v in sorted(d.items())}