



def     a(      A       :    dict       )		->       bool:
					"""simple docstring"""





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






def     a(      A       :    dict ,     A       :    int ,     A       :    set ,     A       :    set       )		->       bool:
					"""simple docstring"""





					visited.add(A       )
					rec_stk.add(A       )

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

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


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

				testmod()





_lowercase: Dict      			=		[
    (1000, "M"),
    (900, "CM"),
    (500, "D"),
    (400, "CD"),
    (100, "C"),
    (90, "XC"),
    (50, "L"),
    (40, "XL"),
    (10, "X"),
    (9, "IX"),
    (5, "V"),
    (4, "IV"),
    (1, "I"),
]






def     a(      A       :    str       )		->       int:
					"""simple docstring"""





					a					     =   {"I": 1, "V": 5, "X": 10, "L": 50, "C": 100, "D": 500, "M": 1000}
					a					     =   0
					a					     =   0
					while place < len(A       ):
										if (place + 1 < len(A       )) and (vals[roman[place]] < vals[roman[place + 1]]):
															total += vals[roman[place + 1]] - vals[roman[place]]
															place += 2
										else:
															total += vals[roman[place]]
															place += 1
					return total






def     a(      A       :    int       )		->       str:
					"""simple docstring"""





					a					     =   []
					for arabic, roman in ROMAN:
										((a)     ,				(a))					     =   divmod(A ,     A       )
										result.append(roman * factor       )
										if number == 0:
															break
					return "".join(A       )


if __name__ == "__main__":
				import doctest

				doctest.testmod()
