






"""simple docstring"""





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



def   a    (     __UpperCAmelCase      :    Any  )    ->							List[str]:
						if not head or not head.next:
												return True

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

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

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

						return True



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











"""simple docstring"""





def   a    (     __UpperCAmelCase      :    int      ,   __UpperCAmelCase      :    int  )    ->							int:
						while b:
												__magic_name__,			__magic_name__:	Optional[int]							=       b, a % b
						return a



def   a    (     __UpperCAmelCase      :    int      ,   __UpperCAmelCase      :    int  )    ->							int:
						return a if b == 0 else euclidean_gcd_recursive(__UpperCAmelCase      ,   a % b  )



def   a    (     )    ->							List[Any]:
						print(f'euclidean_gcd(3, 5) = {euclidean_gcd(3      ,   5  )}'  )
						print(f'euclidean_gcd(5, 3) = {euclidean_gcd(5      ,   3  )}'  )
						print(f'euclidean_gcd(1, 3) = {euclidean_gcd(1      ,   3  )}'  )
						print(f'euclidean_gcd(3, 6) = {euclidean_gcd(3      ,   6  )}'  )
						print(f'euclidean_gcd(6, 3) = {euclidean_gcd(6      ,   3  )}'  )

						print(f'euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3      ,   5  )}'  )
						print(f'euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5      ,   3  )}'  )
						print(f'euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1      ,   3  )}'  )
						print(f'euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3      ,   6  )}'  )
						print(f'euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6      ,   3  )}'  )


if __name__ == "__main__":
							main()



