
'''simple docstring'''

import torch
from torch import autograd






class 				A       (		autograd.Function      ):





	@staticmethod
	def 							__SCREAMING_SNAKE_CASE					(   __magic_name__     :    Optional[Any] ,							__magic_name__     :    torch.tensor ,							__magic_name__     :    float ,							__magic_name__     :    bool							):


				"""simple docstring"""

				lowerCAmelCase__									=							inputs.numel()
				lowerCAmelCase__									=							int(0.005 * nb_elems							) + 1
				if sigmoid:
							lowerCAmelCase__									=							(torch.sigmoid(__magic_name__							) > threshold).type(inputs.type()							)
				else:
							lowerCAmelCase__									=							(inputs > threshold).type(inputs.type()							)
				if mask.sum() < nb_min:
							# We limit the pruning so that at least 0.5% (half a percent) of the weights are remaining
							lowerCAmelCase__									=							inputs.flatten().kthvalue(max(nb_elems - nb_min ,							1							)							).values
							lowerCAmelCase__									=							(inputs > k_threshold).type(inputs.type()							)
				return mask







	@staticmethod
	def 							__SCREAMING_SNAKE_CASE					(   __magic_name__     :    Tuple ,							__magic_name__     :    Union[str, Any]							):


				"""simple docstring"""

				return gradOutput, None, None






class 				A       (		autograd.Function      ):





	@staticmethod
	def 							__SCREAMING_SNAKE_CASE					(   __magic_name__     :    Dict ,							__magic_name__     :    torch.tensor ,							__magic_name__     :    float							):


				"""simple docstring"""

				lowerCAmelCase__									=							inputs.clone()
				lowerCAmelCase__		,lowerCAmelCase__									=							inputs.flatten().sort(descending=__magic_name__							)
				lowerCAmelCase__									=							int(threshold * inputs.numel()							)

				# flat_out and mask access the same memory.
				lowerCAmelCase__									=							mask.flatten()
				lowerCAmelCase__									=							0
				lowerCAmelCase__									=							1
				return mask







	@staticmethod
	def 							__SCREAMING_SNAKE_CASE					(   __magic_name__     :    Tuple ,							__magic_name__     :    Optional[int]							):


				"""simple docstring"""

				return gradOutput, None






class 				A       (		SCREAMING_SNAKE_CASE__      ):





	@staticmethod
	def 							__SCREAMING_SNAKE_CASE					(   __magic_name__     :    torch.tensor ,							__magic_name__     :    float							):


				"""simple docstring"""

				lowerCAmelCase__									=							inputs.clone()
				lowerCAmelCase__		,lowerCAmelCase__									=							inputs.abs().flatten().sort(descending=__magic_name__							)
				lowerCAmelCase__									=							int(threshold * inputs.numel()							)

				# flat_out and mask access the same memory.
				lowerCAmelCase__									=							mask.flatten()
				lowerCAmelCase__									=							0
				lowerCAmelCase__									=							1
				return mask







'''simple docstring'''

def 					A       ( )   ->    str:







			'''simple docstring'''



			lowerCAmelCase__									=							1

			while True:
						if (
						    sorted(str(UpperCamelCase_ ) )
						    == sorted(str(2 * i ) )
						    == sorted(str(3 * i ) )
						    == sorted(str(4 * i ) )
						    == sorted(str(5 * i ) )
						    == sorted(str(6 * i ) )
						):
									return i

						i += 1


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





