"""simple docstring"""

__lowercase    =				[
    ['''ab-e1''', '''ac-e3''', '''ad-e5''', '''bc-e4''', '''bd-e2''', '''be-e6''', '''bh-e12''', '''cd-e2''', '''ce-e4''',
     '''de-e1''', '''df-e8''', '''dg-e5''', '''dh-e10''', '''ef-e3''', '''eg-e2''', '''fg-e6''', '''gh-e6''', '''hi-e3'''],
    ['''ab-e1''', '''ac-e3''', '''ad-e5''', '''bc-e4''', '''bd-e2''', '''be-e6''', '''cd-e2''', '''de-e1''', '''df-e8''',
     '''ef-e3''', '''eg-e2''', '''fg-e6'''],
    ['''ab-e1''', '''ac-e3''', '''bc-e4''', '''bd-e2''', '''de-e1''', '''df-e8''', '''dg-e5''', '''ef-e3''', '''eg-e2''',
     '''eh-e12''', '''fg-e6''', '''fh-e10''', '''gh-e6'''],
    ['''ab-e1''', '''ac-e3''', '''bc-e4''', '''bd-e2''', '''bh-e12''', '''cd-e2''', '''df-e8''', '''dh-e10'''],
    ['''ab-e1''', '''ac-e3''', '''ad-e5''', '''bc-e4''', '''bd-e2''', '''cd-e2''', '''ce-e4''', '''de-e1''', '''df-e8''',
     '''dg-e5''', '''ef-e3''', '''eg-e2''', '''fg-e6''']
]


def    lowerCAmelCase			(__UpperCamelCase							:    List[str]			):
							"""simple docstring"""


							__UpperCamelCase							=set()
							for row in edge_array:
														for item in row:
																					distinct_edge.add(item[0]			)
							return list(__UpperCamelCase			)


def    lowerCAmelCase			(__UpperCamelCase							:    Union[str, Any]							,					__UpperCamelCase							:    Any			):
							"""simple docstring"""


							__UpperCamelCase							=['''0'''] * len(__UpperCamelCase			)
							for i, row in enumerate(__UpperCamelCase			):
														for item in row:
																					if distinct_edge in item[0]:
																												__UpperCamelCase							='''1'''
																												break
							return "".join(__UpperCamelCase			)


def    lowerCAmelCase			(__UpperCamelCase							:    int			):
							"""simple docstring"""


							__UpperCamelCase							=get_distinct_edge(__UpperCamelCase			)
							__UpperCamelCase							={}

							for item in distinct_edge:
														__UpperCamelCase							=get_bitcode(__UpperCamelCase							,					__UpperCamelCase			)
														# print('bit',bit)
														# bt=''.join(bit)
														__UpperCamelCase							=bit.count('''1'''			)
														__UpperCamelCase							=[s, bit]
							# Store [Distinct edge, WT(Bitcode), Bitcode] in descending order
							__UpperCamelCase							=[
							    [k, v[0], v[1]]
							    for k, v in sorted(frequency_table.items()							,					key=lambda __UpperCamelCase			: v[1][0]							,					reverse=__UpperCamelCase			)
							]
							return sorted_frequency_table


def    lowerCAmelCase			(__UpperCamelCase							:    Union[str, Any]			):
							"""simple docstring"""


							__UpperCamelCase							={}
							for _, item in enumerate(__UpperCamelCase			):
														nodes.setdefault(item[2]							,					[]			).append(item[0]			)
							return nodes


def    lowerCAmelCase			(__UpperCamelCase							:    Optional[Any]			):
							"""simple docstring"""


							__UpperCamelCase							={}
							for key, value in nodes.items():
														__UpperCamelCase							=value
							return cluster


def    lowerCAmelCase			(__UpperCamelCase							:    List[Any]			):
							"""simple docstring"""


							return [i * 1_0_0 / len(__UpperCamelCase			) for i in cluster]


def    lowerCAmelCase			():
							"""simple docstring"""


							print('''\nNodes\n'''			)
							for key, value in nodes.items():
														print(__UpperCamelCase							,					__UpperCamelCase			)
							print('''\nSupport\n'''			)
							print(__UpperCamelCase			)
							print('''\n Cluster \n'''			)
							for key, value in sorted(cluster.items()							,					reverse=__UpperCamelCase			):
														print(__UpperCamelCase							,					__UpperCamelCase			)
							print('''\n Graph\n'''			)
							for key, value in graph.items():
														print(__UpperCamelCase							,					__UpperCamelCase			)
							print('''\n Edge List of Frequent subgraphs \n'''			)
							for edge_list in freq_subgraph_edge_list:
														print(__UpperCamelCase			)


def    lowerCAmelCase			(__UpperCamelCase							:    int							,					__UpperCamelCase							:    Optional[Any]							,					__UpperCamelCase							:    Optional[Any]							,					__UpperCamelCase							:    Optional[Any]			):
							"""simple docstring"""


							for i in cluster[ca]:
														__UpperCamelCase							=0
														__UpperCamelCase							=ca + 1
														while ca < max(cluster.keys()			):
																					for j in cluster[ca]:
																												if int(__UpperCamelCase							,					2			) & int(__UpperCamelCase							,					2			) == int(__UpperCamelCase							,					2			):
																																			if tuple(nodes[i]			) in graph:
																																										graph[tuple(nodes[i]			)].append(nodes[j]			)
																																			else:
																																										__UpperCamelCase							=[nodes[j]]
																																			count += 1
																					if count == 0:
																												__UpperCamelCase							=ca + 1
																					else:
																												break


def    lowerCAmelCase			(__UpperCamelCase							:    Any							,					__UpperCamelCase							:    Tuple			):
							"""simple docstring"""


							__UpperCamelCase							=cluster[max(cluster.keys()			)]
							__UpperCamelCase							='''Header'''
							__UpperCamelCase							={}
							for i in x:
														if (["Header"],) in graph:
																					graph[(["Header"],)].append(x[i]			)
														else:
																					__UpperCamelCase							=[x[i]]
							for i in x:
														__UpperCamelCase							=[['''Header''']]
							__UpperCamelCase							=1
							while i < max(__UpperCamelCase			) - 1:
														create_edge(__UpperCamelCase							,					__UpperCamelCase							,					__UpperCamelCase							,					__UpperCamelCase			)
														__UpperCamelCase							=i + 1
							return graph


def    lowerCAmelCase			(__UpperCamelCase							:    List[Any]							,					__UpperCamelCase							:    Union[str, Any]							,					__UpperCamelCase							:    int							,					__UpperCamelCase							:    Union[str, Any]=None			):
							"""simple docstring"""


							__UpperCamelCase							=(path or []) + [start]
							if start == end:
														paths.append(__UpperCamelCase			)
							for node in graph[start]:
														if tuple(__UpperCamelCase			) not in path:
																					my_dfs(__UpperCamelCase							,					tuple(__UpperCamelCase			)							,					__UpperCamelCase							,					__UpperCamelCase			)


def    lowerCAmelCase			(__UpperCamelCase							:    List[Any]							,					__UpperCamelCase							:    int							,					__UpperCamelCase							:    Any			):
							"""simple docstring"""


							__UpperCamelCase							=int(s / 1_0_0 * (len(__UpperCamelCase			) - 1)			)
							for i in cluster[k]:
														my_dfs(__UpperCamelCase							,					tuple(cluster[k][i]			)							,					(['''Header'''],)			)


def    lowerCAmelCase			(__UpperCamelCase							:    List[str]			):
							"""simple docstring"""


							__UpperCamelCase							=[]
							for edges in paths:
														__UpperCamelCase							=[]
														for j in range(len(__UpperCamelCase			) - 1			):
																					__UpperCamelCase							=list(edges[j]			)
																					for e in temp:
																												__UpperCamelCase							=(e[0], e[1])
																												el.append(__UpperCamelCase			)
														freq_sub_el.append(__UpperCamelCase			)
							return freq_sub_el


def    lowerCAmelCase			(__UpperCamelCase							:    List[Any]			):
							"""simple docstring"""


							for i in range(len(__UpperCamelCase			)			):
														for j in range(len(edge_array[i]			)			):
																					__UpperCamelCase							=edge_array[i][j].split('''-'''			)
																					__UpperCamelCase							=t


if __name__ == "__main__":
				preprocess(edge_array)
				__lowercase    =				get_frequency_table(edge_array)
				__lowercase    =				get_nodes(frequency_table)
				__lowercase    =				get_cluster(nodes)
				__lowercase    =				get_support(cluster)
				__lowercase    =				construct_graph(cluster, nodes)
				find_freq_subgraph_given_support(60, cluster, graph)
				__lowercase    =				[]
				__lowercase    =				freq_subgraphs_edge_list(paths)
				print_all()




"""simple docstring"""

def    lowerCAmelCase			(__UpperCamelCase							:    int							,					__UpperCamelCase							:    int			):
							"""simple docstring"""


							return (input_a, input_a).count(0			) % 2


def    lowerCAmelCase			():
							"""simple docstring"""


							assert xor_gate(0							,					0			) == 0
							assert xor_gate(0							,					1			) == 1
							assert xor_gate(1							,					0			) == 1
							assert xor_gate(1							,					1			) == 0


if __name__ == "__main__":
				print(xor_gate(0, 0))
				print(xor_gate(0, 1))



