






def       __lowerCAmelCase      (						__snake_case       ):
     __lowerCAmelCase								=					set()
     # To detect a back edge, keep track of vertices currently in the recursion stack
     __lowerCAmelCase								=					set()
     return any(
         node not in visited and depth_first_search(__snake_case					, __snake_case					, __snake_case					, __snake_case       )
         for node in graph       )





def       __lowerCAmelCase      (						__snake_case					, __snake_case					, __snake_case					, __snake_case       ):
     visited.add(__snake_case       )
     rec_stk.add(__snake_case       )

     for node in graph[vertex]:
          if node not in visited:
               if depth_first_search(__snake_case					, __snake_case					, __snake_case					, __snake_case       ):
                    return True
          elif node in rec_stk:
               return True

    # The node needs to be removed from recursion stack before function ends
     rec_stk.remove(__snake_case       )
     return False


if __name__ == "__main__":
 from doctest import testmod

 testmod()














import random



class 							_UpperCamelCase			:


      @staticmethod
      def  __UpperCAmelCase		(	__UpperCamelCase	)->	tuple[list[int], list[int]]:
           __lowerCAmelCase								=					[ord(__UpperCamelCase	) for i in text]
           __lowerCAmelCase								=					[]
           __lowerCAmelCase								=					[]
           for i in plain:
                __lowerCAmelCase								=					random.randint(1					,						3_0_0	)
                __lowerCAmelCase								=					(i + k) * k
                cipher.append(__UpperCamelCase	)
                key.append(__UpperCamelCase	)
           return cipher, key


      @staticmethod
      def  __UpperCAmelCase		(	__UpperCamelCase					,						__UpperCamelCase	)->	str:
           __lowerCAmelCase								=					[]
           for i in range(len(__UpperCamelCase	)	):
                __lowerCAmelCase								=					int((cipher[i] - (key[i]) ** 2) / key[i]	)
                plain.append(chr(__UpperCamelCase	)	)
           return "".join(__UpperCamelCase	)


if __name__ == "__main__":
 lowerCamelCase      ,					lowerCamelCase			:					List[Any]         =	Onepad().encrypt('''Hello''')
 print(c, k)
 print(Onepad().decrypt(c, k))






