




def        lowerCAmelCase_			(  snake_case_,snake_case_  ):

						# Check if the input is valid
						if not len(_lowerCAmelCase  ) == len(_lowerCAmelCase  ) == 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
						_A    ,     _A    ,     _A							:  Any    =		equationa
						_A    ,     _A    ,     _A							:  Dict    =		equationa

						# Calculate the determinants of the matrices
						_A							:  Optional[Any]    =		aa * ba - aa * ba
						_A							:  Dict    =		ca * ba - ca * ba
						_A							:  Dict    =		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:
																		_A							:  Any    =		determinant_x / determinant
																		_A							:  Optional[Any]    =		determinant_y / determinant
																		# Non-Trivial Solution (Consistent system)
																		return (x, y)







import operator







def        lowerCAmelCase_			(  snake_case_,snake_case_ = False,snake_case_ = None  ):
      _A							:  str    =		operator.lt if reverse else operator.gt
      _A							:  Optional[Any]    =		solution or []

      if not arr:
            return solution

      _A							:  Dict    =		[arr.pop(0  )]
      for i, item in enumerate(snake_case_  ):
            if _operator(snake_case_,sublist[-1]  ):
                  sublist.append(snake_case_  )
                  arr.pop(snake_case_  )

    #  merging sublist into solution list
      if not solution:
            solution.extend(snake_case_  )
      else:
            while sublist:
                  _A							:  Union[str, Any]    =		sublist.pop(0  )
                  for i, xx in enumerate(snake_case_  ):
                        if not _operator(snake_case_,snake_case_  ):
                              solution.insert(snake_case_,snake_case_  )
                              break
                  else:
                        solution.append(snake_case_  )

      strand_sort(snake_case_,snake_case_,snake_case_  )
      return solution


if __name__ == "__main__":
  assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
  assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]

