| f | class ExceptionTree: | f | class ExceptionTree: | 
            |  |  |  |  | 
            |  | def __init__(self): |  | def __init__(self): | 
            | n | self.exceptions = {} | n | self._exceptions = {} | 
            |  |  |  |  | 
            | n | def __call__(self, n): | n | def __call__(self, index): | 
            |  | if n in self.exceptions: |  | if index in self._exceptions: | 
            |  | return self.exceptions[n] |  | return self._exceptions[index] | 
            |  | if n == 1: |  | if index == 1: | 
            |  | par = Exception |  | base_exception = Exception | 
            |  | else: |  | else: | 
            | t | par = self(n // 2) | t | base_exception = self(index // 2) | 
            |  | new_exc = type(f'Exception-{n}', (par,), {'n': n}) |  | new_exception = type(f'Exception-{index}', (base_exception,), {' | 
            |  |  |  | n': index}) | 
            |  | self.exceptions[n] = new_exc |  | self._exceptions[index] = new_exception | 
            |  | return new_exc |  | return new_exception |