```python
LADDER = (("m", 1000), ("cm", 10), ("mm", 1))


def split_length(mm: int) -> str:
    if not isinstance(mm, int) or mm < 0:
        raise ValueError("Length must be a whole number and not negative.")

    result = []
    for unit, value in LADDER:
        count = mm // value
        if count > 0:
            result.append(f"{count}{unit}")
            mm %= value

    return " ".join(result) if result else "0mm"
```