

import os
from shutil import copyfile
from typing import Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


lowerCAmelCase_       	=	logging.get_logger(__name__)

lowerCAmelCase_       	=	'''▁'''

lowerCAmelCase_       	=	{'''vocab_file''': '''sentencepiece.bpe.model'''}

lowerCAmelCase_       	=	{
    '''vocab_file''': {
        '''facebook/xglm-564M''': '''https://huggingface.co/facebook/xglm-564M/resolve/main/sentencepiece.bpe.model''',
    }
}

lowerCAmelCase_       	=	{
    '''facebook/xglm-564M''': 20_48,
}





class 	snake_case_   (		__A					):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE     :   Tuple									=				VOCAB_FILES_NAMES
			SCREAMING_SNAKE_CASE     :   str									=				PRETRAINED_VOCAB_FILES_MAP
			SCREAMING_SNAKE_CASE     :   Any									=				PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
			SCREAMING_SNAKE_CASE     :   Optional[Any]									=				["input_ids", "attention_mask"]







			def __init__(     self :				Dict							,   _UpperCamelCase :				List[Any]							,   _UpperCamelCase :				int="<s>"							,   _UpperCamelCase :				int="</s>"							,   _UpperCamelCase :				Optional[int]="</s>"							,   _UpperCamelCase :				Tuple="<s>"							,   _UpperCamelCase :				Dict="<unk>"							,   _UpperCamelCase :				List[str]="<pad>"							,   _UpperCamelCase :				Optional[Dict[str, Any]] = None							,   **_UpperCamelCase :				Optional[Any]							,   )      ->None:
									snake_case_   =	{} if sp_model_kwargs is None else sp_model_kwargs

									# Compatibility with the original tokenizer
									snake_case_   =	7
									snake_case_   =	[f'''<madeupword{i}>''' for i in range(self.num_madeup_words							)]

									snake_case_   =	kwargs.get('''additional_special_tokens'''							,   []							)
									kwargs["additional_special_tokens"] += [
									    word for word in madeup_words if word not in kwargs["additional_special_tokens"]
									]

									super().__init__(
									    bos_token=_UpperCamelCase							,   eos_token=_UpperCamelCase							,   unk_token=_UpperCamelCase							,   sep_token=_UpperCamelCase							,   cls_token=_UpperCamelCase							,   pad_token=_UpperCamelCase							,   sp_model_kwargs=self.sp_model_kwargs							,   **_UpperCamelCase							,   )

									snake_case_   =	spm.SentencePieceProcessor(**self.sp_model_kwargs							)
									self.sp_model.Load(str(_UpperCamelCase							)							)
									snake_case_   =	vocab_file

									# Original fairseq vocab and spm vocab must be "aligned":
									# Vocab    |    0    |    1    |   2    |    3    |  4  |  5  |  6  |   7   |   8   |  9
									# -------- | ------- | ------- | ------ | ------- | --- | --- | --- | ----- | ----- | ----
									# fairseq  | '<s>'   | '<pad>' | '</s>' | '<unk>' | ',' | '.' | '▁' | 's'   | '▁de' | '-'
									# spm      | '<unk>' | '<s>'   | '</s>' | ','     | '.' | '▁' | 's' | '▁de' | '-'   | '▁a'

									# The first "real" token "," has position 4 in the original fairseq vocab and position 3 in the spm vocab
									snake_case_   =	1

									# Mimic fairseq token-to-id alignment for the first 4 token
									snake_case_   =	{'''<s>''': 0, '''<pad>''': 1, '''</s>''': 2, '''<unk>''': 3}

									snake_case_   =	len(self.sp_model							)
									snake_case_   =	{f'''<madeupword{i}>''': sp_size + i + self.fairseq_offset for i in range(self.num_madeup_words							)}
									self.fairseq_tokens_to_ids.update(_UpperCamelCase							)

									snake_case_   =	{v: k for k, v in self.fairseq_tokens_to_ids.items()}







			def __getstate__(     self :				Union[str, Any]							)      ->str:
									snake_case_   =	self.__dict__.copy()
									snake_case_   =	None
									snake_case_   =	self.sp_model.serialized_model_proto()
									return state







			def __setstate__(     self :				Any							,   _UpperCamelCase :				Union[str, Any]							)      ->Optional[Any]:
									snake_case_   =	d

									# for backward compatibility
									if not hasattr(self							,   '''sp_model_kwargs'''							):
															snake_case_   =	{}

									snake_case_   =	spm.SentencePieceProcessor(**self.sp_model_kwargs							)
									self.sp_model.LoadFromSerializedProto(self.sp_model_proto							)







			def 				snake_case__(     self :				str							,   _UpperCamelCase :				List[int]							,   _UpperCamelCase :				Optional[List[int]] = None							)      ->List[int]:

									if token_ids_a is None:
															return [self.sep_token_id] + token_ids_a
									snake_case_   =	[self.sep_token_id]
									return sep + token_ids_a + sep + sep + token_ids_a







			def 				snake_case__(     self :				List[Any]							,   _UpperCamelCase :				List[int]							,   _UpperCamelCase :				Optional[List[int]] = None							,   _UpperCamelCase :				bool = False							)      ->List[int]:

									if already_has_special_tokens:
															return super().get_special_tokens_mask(
															    token_ids_a=_UpperCamelCase							,   token_ids_a=_UpperCamelCase							,   already_has_special_tokens=_UpperCamelCase							)

									if token_ids_a is None:
															return [1] + ([0] * len(_UpperCamelCase							))
									return [1] + ([0] * len(_UpperCamelCase							)) + [1, 1] + ([0] * len(_UpperCamelCase							))







			def 				snake_case__(     self :				Tuple							,   _UpperCamelCase :				List[int]							,   _UpperCamelCase :				Optional[List[int]] = None							)      ->List[int]:
									snake_case_   =	[self.sep_token_id]

									if token_ids_a is None:
															return len(sep + token_ids_a							) * [0]
									return len(sep + token_ids_a + sep + sep + token_ids_a							) * [0]







			@property
			def 				snake_case__(     self :				int							)      ->Union[str, Any]:
									return len(self.sp_model							) + self.fairseq_offset + self.num_madeup_words







			def 				snake_case__(     self :				Any							)      ->int:
									snake_case_   =	{self.convert_ids_to_tokens(_UpperCamelCase							): i for i in range(self.vocab_size							)}
									vocab.update(self.added_tokens_encoder							)
									return vocab







			def 				snake_case__(     self :				int							,   _UpperCamelCase :				str							)      ->List[str]:
									return self.sp_model.encode(_UpperCamelCase							,   out_type=_UpperCamelCase							)







			def 				snake_case__(     self :				Optional[Any]							,   _UpperCamelCase :				Optional[Any]							)      ->Optional[int]:
									if token in self.fairseq_tokens_to_ids:
															return self.fairseq_tokens_to_ids[token]
									snake_case_   =	self.sp_model.PieceToId(_UpperCamelCase							)

									# Need to return unknown token if the SP model returned 0
									return spm_id + self.fairseq_offset if spm_id else self.unk_token_id







			def 				snake_case__(     self :				Dict							,   _UpperCamelCase :				List[str]							)      ->int:
									if index in self.fairseq_ids_to_tokens:
															return self.fairseq_ids_to_tokens[index]
									return self.sp_model.IdToPiece(index - self.fairseq_offset							)







			def 				snake_case__(     self :				Tuple							,   _UpperCamelCase :				int							)      ->str:
									snake_case_   =	''''''.join(_UpperCamelCase							).replace(_UpperCamelCase							,   ''' '''							).strip()
									return out_string







			def 				snake_case__(     self :				Dict							,   _UpperCamelCase :				str							,   _UpperCamelCase :				Optional[str] = None							)      ->Tuple[str]:
									if not os.path.isdir(_UpperCamelCase							):
															logger.error(f'''Vocabulary path ({save_directory}) should be a directory'''							)
															return
									snake_case_   =	os.path.join(
									    _UpperCamelCase							,   (filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']							)

									if os.path.abspath(self.vocab_file							) != os.path.abspath(_UpperCamelCase							) and os.path.isfile(self.vocab_file							):
															copyfile(self.vocab_file							,   _UpperCamelCase							)
									elif not os.path.isfile(self.vocab_file							):
															with open(_UpperCamelCase							,   '''wb'''							) as fi:
																					snake_case_   =	self.sp_model.serialized_model_proto()
																					fi.write(_UpperCamelCase							)

									return (out_vocab_file,)


import math


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
						if 0 not in (x, y):
												# We use the relation x^y = y*log10(x), where 10 is the base.
												return y * math.logaa(SCREAMING_SNAKE_CASE__       )
						else:
												if x == 0:  # 0 raised to any number is 0
																		return 0
												elif y == 0:
																		return 1  # any number raised to 0 is 1
						raise AssertionError('''This should never happen'''       )


if __name__ == "__main__":  # Main function
					# Read two numbers from input and typecast them to int using map function.
					# Here x is the base and y is the power.
					lowerCAmelCase_       	=	'''Enter the base and the power separated by a comma: '''
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))
					lowerCAmelCase_	,      lowerCAmelCase_       	=	map(int, input(prompt).split(''','''))

					# We find the log of each number, using the function res(), which takes two
					# arguments.
					lowerCAmelCase_       	=	res(xa, ya)
					lowerCAmelCase_       	=	res(xa, ya)

					# We check for the largest number
					if resa > resa:
										print('''Largest number is''', xa, '''^''', ya)
					elif resa > resa:
										print('''Largest number is''', xa, '''^''', ya)
					else:
										print('''Both are equal''')