


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase		=						logging.get_logger(__name__)

lowerCamelCase		=						{
    '''facebook/sam-vit-huge''': '''https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json''',
    '''facebook/sam-vit-large''': '''https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json''',
    '''facebook/sam-vit-base''': '''https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json''',
}





class    _a				(							snake_case__):




	def __init__(   self		:						Optional[int]						,   _SCREAMING_SNAKE_CASE		:						Optional[Any]=256						,   _SCREAMING_SNAKE_CASE		:						int=1024						,   _SCREAMING_SNAKE_CASE		:						Union[str, Any]=16						,   _SCREAMING_SNAKE_CASE		:						Optional[Any]=16						,   _SCREAMING_SNAKE_CASE		:						Any=4						,   _SCREAMING_SNAKE_CASE		:						List[Any]="gelu"						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=1E-6						,   **_SCREAMING_SNAKE_CASE		:						Optional[Any]						,   )->			int:
			super().__init__(**_A						)
			lowerCAmelCase__  :     Optional[int]       	=   hidden_size
			lowerCAmelCase__  :     int       	=   image_size
			lowerCAmelCase__  :     Dict       	=   patch_size
			lowerCAmelCase__  :     int       	=   image_size // patch_size
			lowerCAmelCase__  :     Any       	=   mask_input_channels
			lowerCAmelCase__  :     Union[str, Any]       	=   num_point_embeddings
			lowerCAmelCase__  :     Optional[Any]       	=   hidden_act
			lowerCAmelCase__  :     Dict       	=   layer_norm_eps





class    _a				(							snake_case__):




	def __init__(   self		:						Dict						,   _SCREAMING_SNAKE_CASE		:						Any=256						,   _SCREAMING_SNAKE_CASE		:						int="relu"						,   _SCREAMING_SNAKE_CASE		:						List[str]=2048						,   _SCREAMING_SNAKE_CASE		:						str=2						,   _SCREAMING_SNAKE_CASE		:						Dict=8						,   _SCREAMING_SNAKE_CASE		:						Tuple=2						,   _SCREAMING_SNAKE_CASE		:						Union[str, Any]=3						,   _SCREAMING_SNAKE_CASE		:						int=3						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=256						,   _SCREAMING_SNAKE_CASE		:						Tuple=1E-6						,   **_SCREAMING_SNAKE_CASE		:						List[str]						,   )->			List[Any]:
			super().__init__(**_A						)
			lowerCAmelCase__  :     List[Any]       	=   hidden_size
			lowerCAmelCase__  :     List[Any]       	=   hidden_act
			lowerCAmelCase__  :     Optional[int]       	=   mlp_dim
			lowerCAmelCase__  :     Any       	=   num_hidden_layers
			lowerCAmelCase__  :     List[str]       	=   num_attention_heads
			lowerCAmelCase__  :     str       	=   attention_downsample_rate
			lowerCAmelCase__  :     List[Any]       	=   num_multimask_outputs
			lowerCAmelCase__  :     Optional[int]       	=   iou_head_depth
			lowerCAmelCase__  :     List[str]       	=   iou_head_hidden_dim
			lowerCAmelCase__  :     Dict       	=   layer_norm_eps





class    _a				(							snake_case__):




	def __init__(   self		:						List[Any]						,   _SCREAMING_SNAKE_CASE		:						Optional[Any]=768						,   _SCREAMING_SNAKE_CASE		:						List[str]=256						,   _SCREAMING_SNAKE_CASE		:						List[Any]=12						,   _SCREAMING_SNAKE_CASE		:						List[Any]=12						,   _SCREAMING_SNAKE_CASE		:						Tuple=3						,   _SCREAMING_SNAKE_CASE		:						List[str]=1024						,   _SCREAMING_SNAKE_CASE		:						int=16						,   _SCREAMING_SNAKE_CASE		:						List[Any]="gelu"						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=1E-06						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=0.0						,   _SCREAMING_SNAKE_CASE		:						str=1E-10						,   _SCREAMING_SNAKE_CASE		:						List[str]=True						,   _SCREAMING_SNAKE_CASE		:						str=4.0						,   _SCREAMING_SNAKE_CASE		:						Any=True						,   _SCREAMING_SNAKE_CASE		:						Tuple=True						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=14						,   _SCREAMING_SNAKE_CASE		:						Tuple=[2, 5, 8, 11]						,   _SCREAMING_SNAKE_CASE		:						Tuple=128						,   _SCREAMING_SNAKE_CASE		:						Optional[int]=None						,   **_SCREAMING_SNAKE_CASE		:						int						,   )->			Optional[int]:
			super().__init__(**_A						)

			lowerCAmelCase__  :     Optional[int]       	=   hidden_size
			lowerCAmelCase__  :     Optional[Any]       	=   output_channels
			lowerCAmelCase__  :     List[Any]       	=   num_hidden_layers
			lowerCAmelCase__  :     List[str]       	=   num_attention_heads
			lowerCAmelCase__  :     str       	=   num_channels
			lowerCAmelCase__  :     List[Any]       	=   image_size
			lowerCAmelCase__  :     Dict       	=   patch_size
			lowerCAmelCase__  :     Tuple       	=   hidden_act
			lowerCAmelCase__  :     Optional[Any]       	=   layer_norm_eps
			lowerCAmelCase__  :     Dict       	=   attention_dropout
			lowerCAmelCase__  :     List[str]       	=   initializer_range
			lowerCAmelCase__  :     Union[str, Any]       	=   qkv_bias
			lowerCAmelCase__  :     Tuple       	=   mlp_ratio
			lowerCAmelCase__  :     Any       	=   use_abs_pos
			lowerCAmelCase__  :     List[Any]       	=   use_rel_pos
			lowerCAmelCase__  :     List[str]       	=   window_size
			lowerCAmelCase__  :     Union[str, Any]       	=   global_attn_indexes
			lowerCAmelCase__  :     Optional[Any]       	=   num_pos_feats
			lowerCAmelCase__  :     List[Any]       	=   int(hidden_size * mlp_ratio						) if mlp_dim is None else mlp_dim





class    _a				(							snake_case__):
	_a    :    Optional[int]        =				"""sam"""
	_a    :    Dict        =				True




	def __init__(   self		:						Union[str, Any]						,   _SCREAMING_SNAKE_CASE		:						List[str]=None						,   _SCREAMING_SNAKE_CASE		:						List[str]=None						,   _SCREAMING_SNAKE_CASE		:						str=None						,   _SCREAMING_SNAKE_CASE		:						Optional[Any]=0.02						,   **_SCREAMING_SNAKE_CASE		:						List[Any]						,   )->			List[Any]:
			super().__init__(**_A						)
			lowerCAmelCase__  :     Tuple       	=   vision_config if vision_config is not None else {}
			lowerCAmelCase__  :     Optional[int]       	=   prompt_encoder_config if prompt_encoder_config is not None else {}
			lowerCAmelCase__  :     Tuple       	=   mask_decoder_config if mask_decoder_config is not None else {}

			if isinstance(_A						,   _A						):
					lowerCAmelCase__  :     Dict       	=   vision_config.to_dict()
			if isinstance(_A						,   _A						):
					lowerCAmelCase__  :     Dict       	=   prompt_encoder_config.to_dict()
			if isinstance(_A						,   _A						):
					lowerCAmelCase__  :     Union[str, Any]       	=   mask_decoder_config.to_dict()

			lowerCAmelCase__  :     int       	=   SamVisionConfig(**_A						)
			lowerCAmelCase__  :     Any       	=   SamPromptEncoderConfig(**_A						)
			lowerCAmelCase__  :     List[Any]       	=   SamMaskDecoderConfig(**_A						)
			lowerCAmelCase__  :     List[str]       	=   initializer_range




	def 				UpperCAmelCase__(   self		:						Optional[int]						)->			Any:
			lowerCAmelCase__  :     Union[str, Any]       	=   copy.deepcopy(self.__dict__						)
			lowerCAmelCase__  :     List[Any]       	=   self.vision_config.to_dict()
			lowerCAmelCase__  :     List[str]       	=   self.prompt_encoder_config.to_dict()
			lowerCAmelCase__  :     Optional[Any]       	=   self.mask_decoder_config.to_dict()
			lowerCAmelCase__  :     Optional[Any]       	=   self.__class__.model_type
			return output










def       _a (		SCREAMING_SNAKE_CASE_				:							int , SCREAMING_SNAKE_CASE_				:							int	):
					if a < b:
										return gcd(SCREAMING_SNAKE_CASE_ , SCREAMING_SNAKE_CASE_	)
					if a % b == 0:
										return b
					return gcd(SCREAMING_SNAKE_CASE_ , a % b	)







def       _a (		SCREAMING_SNAKE_CASE_				:							int , SCREAMING_SNAKE_CASE_				:							int , SCREAMING_SNAKE_CASE_				:							int	):
					if y == 0:
										return 1
					__lowerCAmelCase							  =			power(SCREAMING_SNAKE_CASE_ , y // 2 , SCREAMING_SNAKE_CASE_	) % mod
					__lowerCAmelCase							  =			(temp * temp) % mod
					if y % 2 == 1:
										__lowerCAmelCase							  =			(temp * x) % mod
					return temp







def       _a (		SCREAMING_SNAKE_CASE_				:							int	):
					__lowerCAmelCase							  =			2
					while b < n:
										if gcd(SCREAMING_SNAKE_CASE_ , SCREAMING_SNAKE_CASE_	) == 1 and power(SCREAMING_SNAKE_CASE_ , n - 1 , SCREAMING_SNAKE_CASE_	) != 1:
															return False
										b += 1
					return True


if __name__ == "__main__":
					UpperCamelCase__            =     int(input("""Enter number: """).strip())
					if is_carmichael_number(number):
										print(f'''{number} is a Carmichael Number.''')
					else:
										print(f'''{number} is not a Carmichael Number.''')




