def       A__   (						snake_case_			:		int = 1							,					snake_case_			:		int = 1_000   ):
 SCREAMING_SNAKE_CASE__: Dict=   1
 SCREAMING_SNAKE_CASE__: Tuple=   0

 for divide_by_number in range(UpperCAmelCase_							,					digit + 1   ):
  SCREAMING_SNAKE_CASE__: list[int]=   []
  SCREAMING_SNAKE_CASE__: List[str]=   numerator
  for _ in range(1							,					digit + 1   ):
   if now_divide in has_been_divided:
    if longest_list_length < len(UpperCAmelCase_   ):
     SCREAMING_SNAKE_CASE__: List[str]=   len(UpperCAmelCase_   )
     SCREAMING_SNAKE_CASE__: Dict=   divide_by_number
   else:
    has_been_divided.append(UpperCAmelCase_   )
    SCREAMING_SNAKE_CASE__: int=   now_divide * 10 % divide_by_number

 return the_digit


# Tests
if __name__ == "__main__":
      import doctest

      doctest.testmod()



def 							SCREAMING_SNAKE_CASE_	(					UpperCAmelCase_	:     int | float | str				)			->						tuple[int, int]:
       try:
              SCREAMING_SNAKE_CASE_							:				int		=float(UpperCAmelCase_				)
       except ValueError:
              raise ValueError('''Please enter a valid number'''				)
       SCREAMING_SNAKE_CASE_							:				Any		=decimal - int(UpperCAmelCase_				)
       if fractional_part == 0:
              return int(UpperCAmelCase_				), 1
       else:
              SCREAMING_SNAKE_CASE_							:				Any		=len(str(UpperCAmelCase_				).split('''.'''				)[1]				)
              SCREAMING_SNAKE_CASE_							:				str		=int(decimal * (1_0**number_of_frac_digits)				)
              SCREAMING_SNAKE_CASE_							:				Any		=1_0**number_of_frac_digits
              SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_							:				Tuple		=denominator, numerator
              while True:
                     SCREAMING_SNAKE_CASE_							:				Any		=dividend % divisor
                     if remainder == 0:
                            break
                     SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_							:				Optional[int]		=divisor, remainder
              SCREAMING_SNAKE_CASE_	,     SCREAMING_SNAKE_CASE_							:				Optional[int]		=numerator / divisor, denominator / divisor
              return int(UpperCAmelCase_				), int(UpperCAmelCase_				)


if __name__ == "__main__":
 print(F"{decimal_to_fraction(2) = }")
 print(F"{decimal_to_fraction(89.0) = }")
 print(F"{decimal_to_fraction('67') = }")
 print(F"{decimal_to_fraction('45.0') = }")
 print(F"{decimal_to_fraction(1.5) = }")
 print(F"{decimal_to_fraction('6.25') = }")
 print(F"{decimal_to_fraction('78td') = }")
