





'''simple docstring'''



def  _lowerCAmelCase    (					lowerCamelCase_      :	List[str]		,							lowerCamelCase_      :	Any					):







			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
			__lowercase    ,		__lowercase    ,		__lowercase					    =				equationa
			__lowercase    ,		__lowercase    ,		__lowercase					    =				equationa

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








import random

class    _lowercase				:

   @staticmethod
   def     UpperCamelCase					(				lowerCamelCase__	:    str       ) ->			tuple[list[int], list[int]]:
         """simple docstring"""





         A_							       =		[ord(lowerCamelCase__       ) for i in text]
         A_							       =		[]
         A_							       =		[]
         for i in plain:
               A_							       =		random.randint(1			,						3_0_0       )
               A_							       =		(i + k) * k
               cipher.append(lowerCamelCase__       )
               key.append(lowerCamelCase__       )
         return cipher, key





   @staticmethod
   def     UpperCamelCase					(				lowerCamelCase__	:    list[int]			,						lowerCamelCase__	:    list[int]       ) ->			str:
         """simple docstring"""





         A_							       =		[]
         for i in range(len(lowerCamelCase__       )       ):
               A_							       =		int((cipher[i] - (key[i]) ** 2) / key[i]       )
               plain.append(chr(lowerCamelCase__       )       )
         return "".join(lowerCamelCase__       )


if __name__ == "__main__":
      __lowercase      ,				__lowercase				      =						Onepad().encrypt("""Hello""")
      print(c, k)
      print(Onepad().decrypt(c, k))





