def      lowerCamelCase_(__SCREAMING_SNAKE_CASE  )->    list[list]:
							_SCREAMING_SNAKE_CASE		:						Any			  =    current_set.copy()
							for row_index, row in enumerate(__SCREAMING_SNAKE_CASE  ):
														_SCREAMING_SNAKE_CASE		:						Tuple			  =    row[0]
														for column_index, column in enumerate(__SCREAMING_SNAKE_CASE  ):
																					if magnitude == 0:
																												_SCREAMING_SNAKE_CASE		:						List[Any]			  =    column
																												continue
																					_SCREAMING_SNAKE_CASE		:						List[str]			  =    column / magnitude
    # Subtract to cancel term
							_SCREAMING_SNAKE_CASE		:						int			  =    current_set[0]
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    [first_row]
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    current_set[1::]
							for row in current_set:
														_SCREAMING_SNAKE_CASE		:						Tuple			  =    []
														# If first term is 0, it is already in form we want, so we preserve it
														if row[0] == 0:
																					final_set.append(__SCREAMING_SNAKE_CASE  )
																					continue
														for column_index in range(len(__SCREAMING_SNAKE_CASE  )  ):
																					temp_row.append(first_row[column_index] - row[column_index]  )
														final_set.append(__SCREAMING_SNAKE_CASE  )
							# Create next recursion iteration set
							if len(final_set[0]  ) != 3:
														_SCREAMING_SNAKE_CASE		:						List[Any]			  =    final_set[0]
														_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    []
														_SCREAMING_SNAKE_CASE		:						int			  =    []
														for row in final_set[1::]:
																					current_first_column.append(row[0]  )
																					next_iteration.append(row[1::]  )
														_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    simplify(__SCREAMING_SNAKE_CASE  )
														for i in range(len(__SCREAMING_SNAKE_CASE  )  ):
																					resultant[i].insert(0     ,	current_first_column[i]  )
														resultant.insert(0     ,	__SCREAMING_SNAKE_CASE  )
														_SCREAMING_SNAKE_CASE		:						List[str]			  =    resultant
							return final_set



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE  )->    list:
							if len(__SCREAMING_SNAKE_CASE  ) == 0:
														raise IndexError("""solve_simultaneous() requires n lists of length n+1"""  )
							_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    len(__SCREAMING_SNAKE_CASE  ) + 1
							if any(len(__SCREAMING_SNAKE_CASE  ) != _length for item in equations  ):
														raise IndexError("""solve_simultaneous() requires n lists of length n+1"""  )
							for row in equations:
														if any(not isinstance(__SCREAMING_SNAKE_CASE     ,	(int, float)  ) for column in row  ):
																					raise ValueError("""solve_simultaneous() requires lists of integers"""  )
							if len(__SCREAMING_SNAKE_CASE  ) == 1:
														return [equations[0][-1] / equations[0][0]]
							_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    equations.copy()
							if any(0 in row for row in data_set  ):
														_SCREAMING_SNAKE_CASE		:						List[Any]			  =    data_set.copy()
														_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    []
														for row_index, row in enumerate(__SCREAMING_SNAKE_CASE  ):
																					if 0 not in row:
																												_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    data_set.pop(__SCREAMING_SNAKE_CASE  )
																												break
														if not full_row:
																					raise ValueError("""solve_simultaneous() requires at least 1 full equation"""  )
														data_set.insert(0     ,	__SCREAMING_SNAKE_CASE  )
							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    data_set.copy()
							_SCREAMING_SNAKE_CASE		:						Dict			  =    simplify(__SCREAMING_SNAKE_CASE  )
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    simplified[::-1]
							_SCREAMING_SNAKE_CASE		:						list			  =    []
							for row in simplified:
														_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    row[-1]
														if not solutions:
																					if row[-2] == 0:
																												solutions.append(0  )
																												continue
																					solutions.append(current_solution / row[-2]  )
																					continue
														_SCREAMING_SNAKE_CASE		:						List[str]			  =    row.copy()[: len(__SCREAMING_SNAKE_CASE  ) - 1 :]
														while temp_row[0] == 0:
																					temp_row.pop(0  )
														if len(__SCREAMING_SNAKE_CASE  ) == 0:
																					solutions.append(0  )
																					continue
														_SCREAMING_SNAKE_CASE		:						int			  =    temp_row[1::]
														_SCREAMING_SNAKE_CASE		:						str			  =    temp_row[::-1]
														for column_index, column in enumerate(__SCREAMING_SNAKE_CASE  ):
																					current_solution -= column * solutions[column_index]
														solutions.append(__SCREAMING_SNAKE_CASE  )
							_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    []
							for item in solutions:
														final.append(float(round(__SCREAMING_SNAKE_CASE     ,	5  )  )  )
							return final[::-1]


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			lowerCAmelCase_     =	[
			    [2, 1, 1, 1, 1, 4],
			    [1, 2, 1, 1, 1, 5],
			    [1, 1, 2, 1, 1, 6],
			    [1, 1, 1, 2, 1, 7],
			    [1, 1, 1, 1, 2, 8],
			]
			print(solve_simultaneous(eq))
			print(solve_simultaneous([[4, 2]]))



"""simple docstring"""





import argparse
from collections import defaultdict



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  )->    int:
							_SCREAMING_SNAKE_CASE		:						str			  =    F"""{file}_{class_name}_{test_name}"""
							done_test[_id] += 1

							with open(__SCREAMING_SNAKE_CASE     ,	"""r"""  ) as f:
														_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    f.readlines()

							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    F"""class {class_name}("""
							_SCREAMING_SNAKE_CASE		:						List[Any]			  =    F"""{4 * " "}def {test_name}("""
							_SCREAMING_SNAKE_CASE		:						Tuple			  =    F"""{8 * " "}{correct_line.split()[0]}"""
							_SCREAMING_SNAKE_CASE		:						List[Any]			  =    F"""{16 * " "}{correct_line.split()[0]}"""
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    False
							_SCREAMING_SNAKE_CASE		:						Tuple			  =    False
							_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    False
							_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    False
							_SCREAMING_SNAKE_CASE		:						Any			  =    0
							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    0

							_SCREAMING_SNAKE_CASE		:						Dict			  =    []
							for line in lines:
														if line.startswith(__SCREAMING_SNAKE_CASE  ):
																					_SCREAMING_SNAKE_CASE		:						Any			  =    True
														elif in_class and line.startswith(__SCREAMING_SNAKE_CASE  ):
																					_SCREAMING_SNAKE_CASE		:						str			  =    True
														elif in_class and in_func and (line.startswith(__SCREAMING_SNAKE_CASE  ) or line.startswith(__SCREAMING_SNAKE_CASE  )):
																					_SCREAMING_SNAKE_CASE		:						Dict			  =    len(line.split(correct_line.split()[0]  )[0]  )
																					count += 1

																					if count == done_test[_id]:
																												_SCREAMING_SNAKE_CASE		:						int			  =    True

														if in_class and in_func and in_line:
																					if ")" not in line:
																												continue
																					else:
																												_SCREAMING_SNAKE_CASE		:						Any			  =    True

														if in_class and in_func and in_line and insert_line:
																					new_lines.append(F"""{spaces * " "}{correct_line}"""  )
																					_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    False
														else:
																					new_lines.append(__SCREAMING_SNAKE_CASE  )

							with open(__SCREAMING_SNAKE_CASE     ,	"""w"""  ) as f:
														for line in new_lines:
																					f.write(__SCREAMING_SNAKE_CASE  )



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE=None  )->    Optional[Any]:
							if fail is not None:
														with open(__SCREAMING_SNAKE_CASE     ,	"""r"""  ) as f:
																					_SCREAMING_SNAKE_CASE		:						Union[str, Any]			  =    {l.strip() for l in f.readlines()}
							else:
														_SCREAMING_SNAKE_CASE		:						str			  =    None

							with open(__SCREAMING_SNAKE_CASE     ,	"""r"""  ) as f:
														_SCREAMING_SNAKE_CASE		:						str			  =    f.readlines()

							_SCREAMING_SNAKE_CASE		:						str			  =    defaultdict(__SCREAMING_SNAKE_CASE  )
							for line in correct_lines:
														_SCREAMING_SNAKE_CASE  ,				_SCREAMING_SNAKE_CASE  ,				_SCREAMING_SNAKE_CASE  ,				_SCREAMING_SNAKE_CASE		:						Optional[int]			  =    line.split(""";"""  )
														if test_failures is None or "::".join([file, class_name, test_name]  ) in test_failures:
																					overwrite_file(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE  )


if __name__ == "__main__":
			lowerCAmelCase_     =	argparse.ArgumentParser()
			parser.add_argument('''--correct_filename''', help='''filename of tests with expected result''')
			parser.add_argument('''--fail_filename''', help='''filename of test failures''', type=str, default=None)
			lowerCAmelCase_     =	parser.parse_args()

			main(args.correct_filename, args.fail_filename)


