





'''simple docstring'''




def 	_lowerCAmelCase      (  __snake_case  :			Optional[Any]      )					->					List[Any]:
     if not head:
          return True
     # split the list to two parts
     __A			,__A						:			Dict								=	head.next, head
     while fast and fast.next:
          __A						:			str								=	fast.next.next
          __A						:			int								=	slow.next
     __A						:			Union[str, Any]								=	slow.next
     __A						:			List[str]								=	None  # Don't forget here! But forget still works!
     # reverse the second part
     __A						:			List[str]								=	None
     while second:
          __A						:			Dict								=	second.next
          __A						:			Union[str, Any]								=	node
          __A						:			Optional[Any]								=	second
          __A						:			Optional[int]								=	nxt
     # compare two parts
     # second part has the same or one less node
     while node:
          if node.val != head.val:
               return False
          __A						:			int								=	node.next
          __A						:			Optional[int]								=	head.next
     return True






def 	_lowerCAmelCase      (  __snake_case  :			Optional[int]      )					->					Union[str, Any]:
     if not head or not head.next:
          return True

     # 1. Get the midpoint (slow)
     __A						:			Optional[Any]								=	head
     while fast and fast.next:
          __A			,__A						:			str								=	fast.next.next, slow.next

     # 2. Push the second half into the stack
     __A						:			Any								=	[slow.val]
     while slow.next:
          __A						:			Any								=	slow.next
          stack.append(slow.val      )

     # 3. Comparison
     while stack:
          if stack.pop() != cur.val:
               return False
          __A						:			str								=	cur.next

     return True







def 	_lowerCAmelCase      (  __snake_case  :			List[Any]      )					->					Optional[Any]:
     if not head or not head.next:
          return True
     __A						:			List[str]								=	{}
     __A						:			str								=	0
     while head:
          if head.val in d:
               d[head.val].append(snake_case__      )
          else:
               __A						:			Union[str, Any]								=	[pos]
          __A						:			Union[str, Any]								=	head.next
          pos += 1
     __A						:			str								=	pos - 1
     __A						:			List[str]								=	0
     for v in d.values():
          if len(snake_case__      ) % 2 != 0:
               middle += 1
          else:
               __A						:			str								=	0
               for i in range(0			,							len(snake_case__      )      ):
                    if v[i] + v[len(snake_case__      ) - 1 - step] != checksum:
                         return False
                    step += 1
          if middle > 1:
               return False
     return True






'''simple docstring'''




import itertools
import math






def 	_lowerCAmelCase      (  __snake_case  :			int      )					->					bool:

     if 1 < number < 4:
          # 2 and 3 are primes
          return True
     elif number < 2 or number % 2 == 0 or number % 3 == 0:
          # Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
          return False

     # All primes number are in format of 6k +/- 1
     for i in range(5			,							int(math.sqrt(__snake_case      ) + 1      )			,							6      ):
          if number % i == 0 or number % (i + 2) == 0:
               return False
     return True






def 	_lowerCAmelCase      (  )					->					List[Any]:
     __A						:			Optional[Any]								=	2
     while True:
          if is_prime(__snake_case      ):
               yield num
          num += 1






def 	_lowerCAmelCase      (  __snake_case  :			int = 1_00_01      )					->					int:
     return next(itertools.islice(prime_generator()			,							nth - 1			,							__snake_case      )      )


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