






"""simple docstring"""


import torch

from transformers import AutoTokenizer


class    snake_case						(				_lowerCAmelCase		):


   '''simple docstring'''

   def __init__(      self					:	Dict,			_lowerCamelCase					:	Optional[int]    ):

     '''simple docstring'''
     __A		     =					AutoTokenizer.from_pretrained(_lowerCamelCase    )


   def 							_SCREAMING_SNAKE_CASE							(      self					:	str,			_lowerCamelCase					:	Optional[Any]    ):

     '''simple docstring'''

     if isinstance(_lowerCamelCase,			_lowerCamelCase    ) and all(isinstance(_x,			_lowerCamelCase    ) for _x in x    ):
       __A		     =					None
       for l in x:
         __A		     =					self.tokenizer(
             _lowerCamelCase,			padding='''max_length''',			max_length=3_84,			truncation=_lowerCamelCase,			return_tensors='''pt''',			)
         __A		     =					torch.tensor([len(_lowerCamelCase    )]    )
         if d is not None:
           for k in d.keys():
             __A		     =					torch.cat((d[k], t[k]),			0    )
         else:
           __A		     =					t

       __A		     =					torch.tensor(self.tokenizer.convert_tokens_to_ids('''[E]'''    )    )
       __A		     =					torch.tensor(self.tokenizer.convert_tokens_to_ids('''[/E]'''    )    )

     elif isinstance(_lowerCamelCase,			_lowerCamelCase    ) and all(isinstance(_x,			_lowerCamelCase    ) for _x in x    ):
       __A		     =					self.tokenizer(
           _lowerCamelCase,			padding='''max_length''',			max_length=3_84,			truncation=_lowerCamelCase,			return_tensors='''pt''',			)

     else:
       raise Exception(
           '''Type of parameter x was not recognized! Only `list of strings` for query or `list of lists of'''
           ''' strings` for supports are supported.'''    )

     return d






   def 							_SCREAMING_SNAKE_CASE							(      self					:	int,			_lowerCamelCase					:	Union[str, Any],			_lowerCamelCase					:	List[str],			_lowerCamelCase					:	str,			_lowerCamelCase					:	Optional[int],			_lowerCamelCase					:	Any=0.70    ):

     '''simple docstring'''
     __A		     =					[]
     for idx in range(len(W_query['''input_ids''']    )    ):
       __A		     =					__A		     =					range(p_start.shape[1]    )

       __A		     =					[]
       for start_id in start_indexes:
         for end_id in end_indexes:
           if start_id < end_id:
             output.append(
                 (
                     start_id,
                     end_id,
                     p_start[idx][start_id].item(),
                     p_end[idx][end_id].item(),
                 )    )

       output.sort(key=lambda _lowerCamelCase    : (tup[2] * tup[3]),			reverse=_lowerCamelCase    )
       __A		     =					[]
       for k in range(len(_lowerCamelCase    )    ):
         if output[k][2] * output[k][3] >= thresh:
           __A     ,       __A		     =					output[k][0], output[k][1]
           __A		     =					self.tokenizer.decode(W_query['''input_ids'''][idx][c_start_pos:c_end_pos]    )
           temp.append((decoded, output[k][2] * output[k][3])    )

       final_outputs.append(_lowerCamelCase    )

     return final_outputs









import math





def 				A      (	_UpperCAmelCase							:  int       )							->					int:







			'''simple docstring'''
			return sum(int(_UpperCAmelCase       ) for digit in str(_UpperCAmelCase       )       )





def 				A      (	_UpperCAmelCase							:  int = 30       )							->					int:







			'''simple docstring'''
			_UpperCAmelCase									=  []
			for digit in range(2				,  100       ):
						for power in range(2				,  100       ):
									_UpperCAmelCase									=  int(math.pow(_UpperCAmelCase				,  _UpperCAmelCase       )       )
									if digit == digit_sum(_UpperCAmelCase       ):
												digit_to_powers.append(_UpperCAmelCase       )

			digit_to_powers.sort()
			return digit_to_powers[n - 1]


if __name__ == "__main__":
							print(solution())
