




def      __lowerCAmelCase			(					UpperCamelCase = 1000      )     ->	int:
  lowerCAmelCase__       ,			lowerCAmelCase__				:  Optional[int]		       =     1, 1
  lowerCAmelCase__				:  int		       =     []
  for i in range(1	,      n + 1      ):
    lowerCAmelCase__				:  Dict		       =     prev_numerator + 2 * prev_denominator
    lowerCAmelCase__				:  Any		       =     prev_numerator + prev_denominator
    if len(str(UpperCamelCase      )      ) > len(str(UpperCamelCase      )      ):
      result.append(UpperCamelCase      )
    lowerCAmelCase__				:  Optional[int]		       =     numerator
    lowerCAmelCase__				:  Union[str, Any]		       =     denominator

  return len(UpperCamelCase      )


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







from __future__ import annotations



def      __lowerCAmelCase			(					UpperCamelCase      )     ->	list[int]:  # This function is recursive
  lowerCAmelCase__				:  Tuple		       =     len(UpperCamelCase      )
  # If the array contains only one element, we return it (it's the stop condition of
  # recursion)
  if array_length <= 1:
    return array
    # Else
  lowerCAmelCase__				:  Optional[int]		       =     array[0]
  lowerCAmelCase__				:  Union[str, Any]		       =     False
  lowerCAmelCase__				:  List[str]		       =     1
  lowerCAmelCase__				:  list[int]		       =     []
  while not is_found and i < array_length:
    if array[i] < pivot:
      lowerCAmelCase__				:  List[Any]		       =     True
      lowerCAmelCase__				:  Optional[int]		       =     [element for element in array[i:] if element >= array[i]]
      lowerCAmelCase__				:  Any		       =     longest_subsequence(UpperCamelCase      )
      if len(UpperCamelCase      ) > len(UpperCamelCase      ):
        lowerCAmelCase__				:  Optional[int]		       =     temp_array
    else:
      i += 1

  lowerCAmelCase__				:  Optional[Any]		       =     [element for element in array[1:] if element >= pivot]
  lowerCAmelCase__				:  List[Any]		       =     [pivot, *longest_subsequence(UpperCamelCase      )]
  if len(UpperCamelCase      ) > len(UpperCamelCase      ):
    return temp_array
  else:
    return longest_subseq


if __name__ == "__main__":
     import doctest

     doctest.testmod()

