






# using dfs for finding eulerian path traversal


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase ,		__lowerCAmelCase ,		__lowerCAmelCase=None	)->  Optional[Any]:





						"""simple docstring"""



						_UpperCAmelCase									=			(path or []) + [u]
						for v in graph[u]:
												if visited_edge[u][v] is False:
																		_UpperCAmelCase					, _UpperCAmelCase									=			True, True
																		_UpperCAmelCase									=			dfs(__lowerCAmelCase ,		__lowerCAmelCase ,		__lowerCAmelCase ,		__lowerCAmelCase	)
						return path


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  List[Any]:





						"""simple docstring"""



						_UpperCAmelCase									=			0
						_UpperCAmelCase									=			-1
						for i in range(__lowerCAmelCase	):
												if i not in graph.keys():
																		continue
												if len(graph[i]	) % 2 == 1:
																		odd_degree_nodes += 1
																		_UpperCAmelCase									=			i
						if odd_degree_nodes == 0:
												return 1, odd_node
						if odd_degree_nodes == 2:
												return 2, odd_node
						return 3, odd_node


def __A    (      __lowerCAmelCase ,		__lowerCAmelCase	)->  Optional[Any]:





						"""simple docstring"""



						_UpperCAmelCase									=			[[False for _ in range(max_node + 1	)] for _ in range(max_node + 1	)]
						_UpperCAmelCase					, _UpperCAmelCase									=			check_circuit_or_path(__lowerCAmelCase ,		__lowerCAmelCase	)
						if check == 3:
												print('graph is not Eulerian'	)
												print('no path'	)
												return
						_UpperCAmelCase									=			1
						if check == 2:
												_UpperCAmelCase									=			odd_node
												print('graph has a Euler path'	)
						if check == 1:
												print('graph has a Euler cycle'	)
						_UpperCAmelCase									=			dfs(__lowerCAmelCase ,		__lowerCAmelCase ,		__lowerCAmelCase	)
						print(__lowerCAmelCase	)


def __A    (      )->  List[Any]:





						"""simple docstring"""



						_UpperCAmelCase									=			{1: [2, 3, 4], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [4]}
						_UpperCAmelCase									=			{1: [2, 3, 4, 5], 2: [1, 3], 3: [1, 2], 4: [1, 5], 5: [1, 4]}
						_UpperCAmelCase									=			{1: [2, 3, 4], 2: [1, 3, 4], 3: [1, 2], 4: [1, 2, 5], 5: [4]}
						_UpperCAmelCase									=			{1: [2, 3], 2: [1, 3], 3: [1, 2]}
						_UpperCAmelCase									=			{
						    1: [],
						    2: []
						    # all degree is zero
						}
						_UpperCAmelCase									=			10
						check_euler(__lowerCAmelCase ,		__lowerCAmelCase	)
						check_euler(__lowerCAmelCase ,		__lowerCAmelCase	)
						check_euler(__lowerCAmelCase ,		__lowerCAmelCase	)
						check_euler(__lowerCAmelCase ,		__lowerCAmelCase	)
						check_euler(__lowerCAmelCase ,		__lowerCAmelCase	)


if __name__ == "__main__":
		main()

'''simple docstring'''

def      UpperCamelCase_						(					snake_case_       :       list[int]						,		snake_case_       :       list[int]      )					->     tuple[float, float]:






 '''simple docstring'''

 if not len(snake_case_      ) == len(snake_case_      ) == 3:
  raise ValueError("""Please enter a valid equation."""      )
 if equationa[0] == equationa[1] == equationa[0] == equationa[1] == 0:
  raise ValueError("""Both a & b of two equations can't be zero."""      )

 # Extract the coefficients
 __lowerCAmelCase							,       __lowerCAmelCase							,       __lowerCAmelCase											=						equationa
 __lowerCAmelCase							,       __lowerCAmelCase							,       __lowerCAmelCase											=						equationa

 # Calculate the determinants of the matrices
 __lowerCAmelCase											=						aa * ba - aa * ba
 __lowerCAmelCase											=						ca * ba - ca * ba
 __lowerCAmelCase											=						aa * ca - aa * ca

 # Check if the system of linear equations has a solution (using Cramer's rule)
 if determinant == 0:
  if determinant_x == determinant_y == 0:
   raise ValueError("""Infinite solutions. (Consistent system)"""      )
  else:
   raise ValueError("""No solution. (Inconsistent system)"""      )
 else:
  if determinant_x == determinant_y == 0:
   # Trivial solution (Inconsistent system)
   return (0.0, 0.0)
  else:
   __lowerCAmelCase											=						determinant_x / determinant
   __lowerCAmelCase											=						determinant_y / determinant
   # Non-Trivial Solution (Consistent system)
   return (x, y)






