```python
def alias_resolve(aliases: dict, name: str) -> str:
    """Turns a name into whatever it stands for, following one hop and no further."""
    return aliases.get(name, name)


def alias_names(aliases: dict) -> list:
    """Lists every name that stands for something, in alphabetical order."""
    return sorted([name for name, alias in aliases.items() if alias != name])
```