```python
def hex_split(colour: str) -> list:
    if not (len(colour) == 7 and colour[0] == '#' and all(c in '0123456789abcdef' for c in colour[1:])):
        raise ValueError("Invalid input. The colour must be a hash followed by exactly six hexadecimal digits.")
    return [f'{int(colour[i:i+2], 16):02X}' for i in range(1, 7, 2)]

def hex_join(parts: list) -> str:
    return '#' + ''.join(parts)
```