



from __future__ import annotations

from collections.abc import Iterable, Iterator
from dataclasses import dataclass

lowerCamelCase__			= (3, 9, -11, 0, 7, 5, 1, -1)
lowerCamelCase__			= (4, 6, 2, 0, 8, 10, 3, -2)






@dataclass
class    SCREAMING_SNAKE_CASE			:
							__lowerCamelCase	:	int
							__lowerCamelCase	:	Node | None






class    SCREAMING_SNAKE_CASE			:





							def __init__(   self		:		Optional[Any]      ,				__lowercase		:		Iterable[int]	):

											'''simple docstring'''
											__a       =		None
											for i in sorted(__lowercase      ,				reverse=__lowercase	):
															__a       =		Node(__lowercase      ,				self.head	)





							def __iter__(   self		:		Optional[Any]	):

											'''simple docstring'''
											__a       =		self.head
											while node:
															yield node.data
															__a       =		node.next_node





							def __len__(   self		:		Dict	):

											'''simple docstring'''
											return sum(1 for _ in self	)







							def __str__(   self		:		List[Any]	):

											'''simple docstring'''
											return " -> ".join([str(__lowercase	) for node in self]	)



def   lowerCAmelCase__						(							_SCREAMING_SNAKE_CASE       :			SortedLinkedList				,     _SCREAMING_SNAKE_CASE       :			SortedLinkedList    ):
				"""simple docstring"""







				return SortedLinkedList(list(_SCREAMING_SNAKE_CASE    ) + list(_SCREAMING_SNAKE_CASE    )    )


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						lowerCamelCase__			= SortedLinkedList
						print(merge_lists(SSL(test_data_odd), SSL(test_data_even)))





def   lowerCAmelCase__						(							_SCREAMING_SNAKE_CASE       :			int = 3				,     _SCREAMING_SNAKE_CASE       :			int = 7				,     _SCREAMING_SNAKE_CASE       :			int = 100_0000    ):
				"""simple docstring"""







				__a       =		0
				__a       =		1

				for current_denominator in range(1				,     limit + 1    ):
								__a       =		current_denominator * numerator // denominator
								if current_denominator % denominator == 0:
												current_numerator -= 1
								if current_numerator * max_denominator > current_denominator * max_numerator:
												__a       =		current_numerator
												__a       =		current_denominator
				return max_numerator


if __name__ == "__main__":
						print(solution(numerator=3, denominator=7, limit=100_0000))
