



from __future__ import annotations

from fractions import Fraction
from math import gcd, sqrt






def        A       (      _lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							int				     =					int(number**0.5						)
							return number == sq * sq






def        A       (      _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						):





							'''simple docstring'''




							_lowerCAmelCase  :							int				     =					x_num * y_den * z_den + y_num * x_den * z_den + z_num * x_den * y_den
							_lowerCAmelCase  :							int				     =					x_den * y_den * z_den
							_lowerCAmelCase  :							int				     =					gcd(_lowerCamelCase       ,				_lowerCamelCase						)
							top //= hcf
							bottom //= hcf
							return top, bottom






def        A       (      _lowerCamelCase = 35						):





							'''simple docstring'''




							_lowerCAmelCase  :							set				     =					set()
							_lowerCAmelCase  :							int
							_lowerCAmelCase  :							Fraction				     =					Fraction(0						)
							_lowerCAmelCase  :							tuple[int, int]

							for x_num in range(1       ,				order + 1						):
														for x_den in range(x_num + 1       ,				order + 1						):
																					for y_num in range(1       ,				order + 1						):
																												for y_den in range(y_num + 1       ,				order + 1						):
																																			# n=1
																																			_lowerCAmelCase  :							int				     =					x_num * y_den + x_den * y_num
																																			_lowerCAmelCase  :							List[str]				     =					x_den * y_den
																																			_lowerCAmelCase  :							str				     =					gcd(_lowerCamelCase       ,				_lowerCamelCase						)
																																			z_num //= hcf
																																			z_den //= hcf
																																			if 0 < z_num < z_den <= order:
																																										_lowerCAmelCase  :							Union[str, Any]				     =					add_three(
																																										    _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						)
																																										unique_s.add(_lowerCamelCase						)

																																			# n=2
																																			_lowerCAmelCase  :							List[str]				     =					(
																																			    x_num * x_num * y_den * y_den + x_den * x_den * y_num * y_num
																																			)
																																			_lowerCAmelCase  :							Tuple				     =					x_den * x_den * y_den * y_den
																																			if is_sq(_lowerCamelCase						) and is_sq(_lowerCamelCase						):
																																										_lowerCAmelCase  :							str				     =					int(sqrt(_lowerCamelCase						)						)
																																										_lowerCAmelCase  :							Optional[Any]				     =					int(sqrt(_lowerCamelCase						)						)
																																										_lowerCAmelCase  :							Any				     =					gcd(_lowerCamelCase       ,				_lowerCamelCase						)
																																										z_num //= hcf
																																										z_den //= hcf
																																										if 0 < z_num < z_den <= order:
																																																	_lowerCAmelCase  :							Optional[int]				     =					add_three(
																																																	    _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						)
																																																	unique_s.add(_lowerCamelCase						)

                    # n=-1
																																			_lowerCAmelCase  :							int				     =					x_num * y_num
																																			_lowerCAmelCase  :							Dict				     =					x_den * y_num + x_num * y_den
																																			_lowerCAmelCase  :							Union[str, Any]				     =					gcd(_lowerCamelCase       ,				_lowerCamelCase						)
																																			z_num //= hcf
																																			z_den //= hcf
																																			if 0 < z_num < z_den <= order:
																																										_lowerCAmelCase  :							Dict				     =					add_three(
																																										    _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						)
																																										unique_s.add(_lowerCamelCase						)

																																			# n=2
																																			_lowerCAmelCase  :							List[str]				     =					x_num * x_num * y_num * y_num
																																			_lowerCAmelCase  :							List[Any]				     =					(
																																			    x_den * x_den * y_num * y_num + x_num * x_num * y_den * y_den
																																			)
																																			if is_sq(_lowerCamelCase						) and is_sq(_lowerCamelCase						):
																																										_lowerCAmelCase  :							Union[str, Any]				     =					int(sqrt(_lowerCamelCase						)						)
																																										_lowerCAmelCase  :							List[Any]				     =					int(sqrt(_lowerCamelCase						)						)
																																										_lowerCAmelCase  :							List[str]				     =					gcd(_lowerCamelCase       ,				_lowerCamelCase						)
																																										z_num //= hcf
																																										z_den //= hcf
																																										if 0 < z_num < z_den <= order:
																																																	_lowerCAmelCase  :							Optional[int]				     =					add_three(
																																																	    _lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase       ,				_lowerCamelCase						)
																																																	unique_s.add(_lowerCamelCase						)

							for num, den in unique_s:
														total += Fraction(_lowerCamelCase       ,				_lowerCamelCase						)

							return total.denominator + total.numerator


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





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_snake_case	=						logging.get_logger(__name__)

_snake_case	=						{
    "microsoft/focalnet-tiny": "https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json",
}



class 						UpperCAmelCase_					( a     ,      a):
							lowerCamelCase__         =	'focalnet'







							def __init__(     self,    __a=224,    __a=4,    __a=3,    __a=96,    __a=False,    __a=[192, 384, 768, 768],    __a=[2, 2, 6, 2],    __a=[2, 2, 2, 2],    __a=[3, 3, 3, 3],    __a="gelu",    __a=4.0,    __a=0.0,    __a=0.1,    __a=False,    __a=1E-4,    __a=False,    __a=False,    __a=False,    __a=0.02,    __a=1E-5,    __a=32,    __a=None,    __a=None,    **__a,    ):

														'''simple docstring'''

														super().__init__(**__a)

														_lowerCAmelCase  :							str				     =					image_size
														_lowerCAmelCase  :							List[str]				     =					patch_size
														_lowerCAmelCase  :							List[Any]				     =					num_channels
														_lowerCAmelCase  :							Tuple				     =					embed_dim
														_lowerCAmelCase  :							List[Any]				     =					use_conv_embed
														_lowerCAmelCase  :							Any				     =					hidden_sizes
														_lowerCAmelCase  :							Tuple				     =					depths
														_lowerCAmelCase  :							Dict				     =					focal_levels
														_lowerCAmelCase  :							Optional[Any]				     =					focal_windows
														_lowerCAmelCase  :							str				     =					hidden_act
														_lowerCAmelCase  :							Union[str, Any]				     =					mlp_ratio
														_lowerCAmelCase  :							Any				     =					hidden_dropout_prob
														_lowerCAmelCase  :							Dict				     =					drop_path_rate
														_lowerCAmelCase  :							str				     =					use_layerscale
														_lowerCAmelCase  :							str				     =					layerscale_value
														_lowerCAmelCase  :							Union[str, Any]				     =					use_post_layernorm
														_lowerCAmelCase  :							Optional[int]				     =					use_post_layernorm_in_modulation
														_lowerCAmelCase  :							str				     =					normalize_modulator
														_lowerCAmelCase  :							Any				     =					initializer_range
														_lowerCAmelCase  :							Union[str, Any]				     =					layer_norm_eps
														_lowerCAmelCase  :							Any				     =					encoder_stride
														_lowerCAmelCase  :							List[str]				     =					["stem"] + [f"stage{idx}" for idx in range(1,    len(self.depths) + 1)]
														_lowerCAmelCase     ,					_lowerCAmelCase  :							List[str]				     =					get_aligned_output_features_output_indices(
														    out_features=__a,    out_indices=__a,    stage_names=self.stage_names)
