




"""simple docstring"""


def 					UpperCAmelCase__       (snake_case__							:					list[int]		,   snake_case__							:					list[int]    ):
  """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
  _snake_case		,					_snake_case		,					_snake_case							:		Optional[Any]								=  equationa
  _snake_case		,					_snake_case		,					_snake_case							:		Optional[Any]								=  equationa

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








"""simple docstring"""


def 					UpperCAmelCase__       (snake_case__							:					list    ):
  """simple docstring"""

  if len(snake_case__    ) <= 1:
    return [tuple(snake_case__    )]

  _snake_case							:		List[Any]								=  []

  def generate(snake_case__							:					int		,   snake_case__							:					list    ):
    if k == 1:
      res.append(tuple(arr[:]    )    )
      return

    generate(k - 1		,   snake_case__    )

    for i in range(k - 1    ):
      if k % 2 == 0:  # k is even
        _snake_case		,					_snake_case							:		Optional[Any]								=  arr[k - 1], arr[i]
      else:  # k is odd
        _snake_case		,					_snake_case							:		List[str]								=  arr[k - 1], arr[0]
      generate(k - 1		,   snake_case__    )

  generate(len(snake_case__    )		,   snake_case__    )
  return res


if __name__ == "__main__":
     A_						=				input('''Enter numbers separated by a comma:\n''').strip()
     A_						=				[int(item) for item in user_input.split(''',''')]
     print(heaps(arr))


