





import math



def   __lowercase  ( _SCREAMING_SNAKE_CASE      )					->  bool:


      '''simple docstring'''


      if 1 < number < 4:
            # 2 and 3 are primes
            return True
      elif number < 2 or number % 2 == 0 or number % 3 == 0:
            # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
            return False

      # All primes number are in format of 6k +/- 1
      for i in range(5					,		int(math.sqrt(_SCREAMING_SNAKE_CASE      ) + 1      )					,		6      ):
            if number % i == 0 or number % (i + 2) == 0:
                  return False
      return True



def   __lowercase  ( _SCREAMING_SNAKE_CASE = 60_08_51_47_51_43      )					->  int:


      '''simple docstring'''


      try:
            SCREAMING_SNAKE_CASE						=		int(_SCREAMING_SNAKE_CASE      )
      except (TypeError, ValueError):
            raise TypeError("""Parameter n must be int or castable to int."""      )
      if n <= 0:
            raise ValueError("""Parameter n must be greater than or equal to one."""      )
      SCREAMING_SNAKE_CASE						=		0
      if is_prime(_SCREAMING_SNAKE_CASE      ):
            return n
      while n % 2 == 0:
            n //= 2
      if is_prime(_SCREAMING_SNAKE_CASE      ):
            return n
      for i in range(3					,		int(math.sqrt(_SCREAMING_SNAKE_CASE      )      ) + 1					,		2      ):
            if n % i == 0:
                  if is_prime(n // i      ):
                        SCREAMING_SNAKE_CASE						=		n // i
                        break
                  elif is_prime(_SCREAMING_SNAKE_CASE      ):
                        SCREAMING_SNAKE_CASE						=		i
      return max_number


if __name__ == "__main__":
      print(F'''{solution() = }''')









import copy

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


SCREAMING_SNAKE_CASE_		  =			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_		  =			{
    """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 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     def __init__(				self		:       List[str]		,lowerCamelCase__		:       int=256		,lowerCamelCase__		:       List[Any]=1024		,lowerCamelCase__		:       Any=16		,lowerCamelCase__		:       Union[str, Any]=16		,lowerCamelCase__		:       int=4		,lowerCamelCase__		:       Tuple="gelu"		,lowerCamelCase__		:       Dict=1e-6		,**lowerCamelCase__		:       int		,)	->						List[str]:




           '''simple docstring'''


           super().__init__(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		hidden_size
           SCREAMING_SNAKE_CASE						=		image_size
           SCREAMING_SNAKE_CASE						=		patch_size
           SCREAMING_SNAKE_CASE						=		image_size // patch_size
           SCREAMING_SNAKE_CASE						=		mask_input_channels
           SCREAMING_SNAKE_CASE						=		num_point_embeddings
           SCREAMING_SNAKE_CASE						=		hidden_act
           SCREAMING_SNAKE_CASE						=		layer_norm_eps

class 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     def __init__(				self		:       str		,lowerCamelCase__		:       str=256		,lowerCamelCase__		:       Optional[Any]="relu"		,lowerCamelCase__		:       str=2048		,lowerCamelCase__		:       Union[str, Any]=2		,lowerCamelCase__		:       int=8		,lowerCamelCase__		:       Union[str, Any]=2		,lowerCamelCase__		:       List[Any]=3		,lowerCamelCase__		:       int=3		,lowerCamelCase__		:       Optional[Any]=256		,lowerCamelCase__		:       Tuple=1e-6		,**lowerCamelCase__		:       List[str]		,)	->						Dict:




           '''simple docstring'''


           super().__init__(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		hidden_size
           SCREAMING_SNAKE_CASE						=		hidden_act
           SCREAMING_SNAKE_CASE						=		mlp_dim
           SCREAMING_SNAKE_CASE						=		num_hidden_layers
           SCREAMING_SNAKE_CASE						=		num_attention_heads
           SCREAMING_SNAKE_CASE						=		attention_downsample_rate
           SCREAMING_SNAKE_CASE						=		num_multimask_outputs
           SCREAMING_SNAKE_CASE						=		iou_head_depth
           SCREAMING_SNAKE_CASE						=		iou_head_hidden_dim
           SCREAMING_SNAKE_CASE						=		layer_norm_eps

class 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     def __init__(				self		:       Union[str, Any]		,lowerCamelCase__		:       Optional[Any]=768		,lowerCamelCase__		:       Union[str, Any]=256		,lowerCamelCase__		:       Optional[int]=12		,lowerCamelCase__		:       str=12		,lowerCamelCase__		:       Tuple=3		,lowerCamelCase__		:       Optional[Any]=1024		,lowerCamelCase__		:       Optional[int]=16		,lowerCamelCase__		:       Optional[Any]="gelu"		,lowerCamelCase__		:       int=1e-0_6		,lowerCamelCase__		:       Optional[Any]=0.0		,lowerCamelCase__		:       Tuple=1e-1_0		,lowerCamelCase__		:       Any=True		,lowerCamelCase__		:       List[Any]=4.0		,lowerCamelCase__		:       Optional[int]=True		,lowerCamelCase__		:       Union[str, Any]=True		,lowerCamelCase__		:       List[str]=14		,lowerCamelCase__		:       List[str]=[2, 5, 8, 11]		,lowerCamelCase__		:       Tuple=128		,lowerCamelCase__		:       Dict=None		,**lowerCamelCase__		:       Optional[Any]		,)	->						str:




           '''simple docstring'''


           super().__init__(**lowerCamelCase__			)

           SCREAMING_SNAKE_CASE						=		hidden_size
           SCREAMING_SNAKE_CASE						=		output_channels
           SCREAMING_SNAKE_CASE						=		num_hidden_layers
           SCREAMING_SNAKE_CASE						=		num_attention_heads
           SCREAMING_SNAKE_CASE						=		num_channels
           SCREAMING_SNAKE_CASE						=		image_size
           SCREAMING_SNAKE_CASE						=		patch_size
           SCREAMING_SNAKE_CASE						=		hidden_act
           SCREAMING_SNAKE_CASE						=		layer_norm_eps
           SCREAMING_SNAKE_CASE						=		attention_dropout
           SCREAMING_SNAKE_CASE						=		initializer_range
           SCREAMING_SNAKE_CASE						=		qkv_bias
           SCREAMING_SNAKE_CASE						=		mlp_ratio
           SCREAMING_SNAKE_CASE						=		use_abs_pos
           SCREAMING_SNAKE_CASE						=		use_rel_pos
           SCREAMING_SNAKE_CASE						=		window_size
           SCREAMING_SNAKE_CASE						=		global_attn_indexes
           SCREAMING_SNAKE_CASE						=		num_pos_feats
           SCREAMING_SNAKE_CASE						=		int(hidden_size * mlp_ratio			) if mlp_dim is None else mlp_dim

class 						UpperCamelCase__					( lowerCAmelCase_  ):



     '''simple docstring'''

     __snake_case       :      Any						      =     "sam"
     __snake_case       :      Optional[Any]						      =     True






     def __init__(				self		:       Union[str, Any]		,lowerCamelCase__		:       List[Any]=None		,lowerCamelCase__		:       int=None		,lowerCamelCase__		:       int=None		,lowerCamelCase__		:       int=0.02		,**lowerCamelCase__		:       int		,)	->						str:




           '''simple docstring'''


           super().__init__(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		vision_config if vision_config is not None else {}
           SCREAMING_SNAKE_CASE						=		prompt_encoder_config if prompt_encoder_config is not None else {}
           SCREAMING_SNAKE_CASE						=		mask_decoder_config if mask_decoder_config is not None else {}

           if isinstance(lowerCamelCase__		,lowerCamelCase__			):
                 SCREAMING_SNAKE_CASE						=		vision_config.to_dict()
           if isinstance(lowerCamelCase__		,lowerCamelCase__			):
                 SCREAMING_SNAKE_CASE						=		prompt_encoder_config.to_dict()
           if isinstance(lowerCamelCase__		,lowerCamelCase__			):
                 SCREAMING_SNAKE_CASE						=		mask_decoder_config.to_dict()

           SCREAMING_SNAKE_CASE						=		SamVisionConfig(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		SamPromptEncoderConfig(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		SamMaskDecoderConfig(**lowerCamelCase__			)
           SCREAMING_SNAKE_CASE						=		initializer_range






     def 							SCREAMING_SNAKE_CASE__    (				self		:       Union[str, Any]			)	->						Optional[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE						=		copy.deepcopy(self.__dict__			)
           SCREAMING_SNAKE_CASE						=		self.vision_config.to_dict()
           SCREAMING_SNAKE_CASE						=		self.prompt_encoder_config.to_dict()
           SCREAMING_SNAKE_CASE						=		self.mask_decoder_config.to_dict()
           SCREAMING_SNAKE_CASE						=		self.__class__.model_type
           return output


