def apply_mask(binary: str, mask: str) -> str:
    """Apply the parm mask to the parm binary number.
       A 0 or 1 overwrites the corresponding bit in the value, while an X leaves the bit in the value unchanged."""
    result = ''

    for place in range(36):
        if mask[place] == 'X':
            result += binary[place]
        else:
            result += mask[place]
    return result