





"""simple docstring"""



a_				=    [
    ["""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 	__lowercase  (     snake_case_						:						Union[str, Any]		)     ->Dict:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						str       ,snake_case_						:						Optional[int]		)     ->Optional[int]:



    '''simple docstring'''







    __A					:		Union[str, Any]						=  ['''0'''] * len(snake_case_		)
    for i, row in enumerate(snake_case_		):
        for item in row:
            if distinct_edge in item[0]:
                __A					:		Tuple						=  '''1'''
                break
    return "".join(snake_case_		)







def 	__lowercase  (     snake_case_						:						Dict		)     ->Tuple:



    '''simple docstring'''







    __A					:		Any						=  get_distinct_edge(snake_case_		)
    __A					:		Optional[Any]						=  {}

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







def 	__lowercase  (     snake_case_						:						List[str]		)     ->List[Any]:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						Any		)     ->Tuple:



    '''simple docstring'''







    __A					:		Tuple						=  {}
    for key, value in nodes.items():
        __A					:		List[Any]						=  value
    return cluster







def 	__lowercase  (     snake_case_						:						List[Any]		)     ->Optional[int]:



    '''simple docstring'''







    return [i * 100 / len(snake_case_		) for i in cluster]







def 	__lowercase  (     )     ->None:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						Optional[Any]       ,snake_case_						:						List[str]       ,snake_case_						:						Tuple       ,snake_case_						:						Optional[Any]		)     ->Optional[int]:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						Tuple       ,snake_case_						:						List[Any]		)     ->int:



    '''simple docstring'''







    __A					:		List[Any]						=  cluster[max(cluster.keys()		)]
    __A					:		List[str]						=  '''Header'''
    __A					:		Any						=  {}
    for i in x:
        if (["Header"],) in graph:
            graph[(["Header"],)].append(x[i]		)
        else:
            __A					:		Optional[int]						=  [x[i]]
    for i in x:
        __A					:		Union[str, Any]						=  [['''Header''']]
    __A					:		Any						=  1
    while i < max(snake_case_		) - 1:
        create_edge(snake_case_       ,snake_case_       ,snake_case_       ,snake_case_		)
        __A					:		Any						=  i + 1
    return graph







def 	__lowercase  (     snake_case_						:						List[str]       ,snake_case_						:						str       ,snake_case_						:						Tuple       ,snake_case_						:						Any=None		)     ->Optional[int]:



    '''simple docstring'''







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







def 	__lowercase  (     snake_case_						:						Dict       ,snake_case_						:						Union[str, Any]       ,snake_case_						:						Optional[int]		)     ->str:



    '''simple docstring'''







    __A					:		List[str]						=  int(s / 100 * (len(snake_case_		) - 1)		)
    for i in cluster[k]:
        my_dfs(snake_case_       ,tuple(cluster[k][i]		)       ,(['''Header'''],)		)







def 	__lowercase  (     snake_case_						:						Dict		)     ->Dict:



    '''simple docstring'''







    __A					:		Optional[Any]						=  []
    for edges in paths:
        __A					:		List[Any]						=  []
        for j in range(len(snake_case_		) - 1		):
            __A					:		Union[str, Any]						=  list(edges[j]		)
            for e in temp:
                __A					:		Optional[Any]						=  (e[0], e[1])
                el.append(snake_case_		)
        freq_sub_el.append(snake_case_		)
    return freq_sub_el







def 	__lowercase  (     snake_case_						:						Any		)     ->Any:



    '''simple docstring'''







    for i in range(len(snake_case_		)		):
        for j in range(len(edge_array[i]		)		):
            __A					:		Optional[Any]						=  edge_array[i][j].split('''-'''		)
            __A					:		Optional[int]						=  t


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











"""simple docstring"""



def 	__lowercase  (     snake_case_						:						Union[str, Any]		)     ->Optional[int]:



    '''simple docstring'''







    __A					:		Dict						=  [701, 301, 132, 57, 23, 10, 4, 1]
    for gap in gaps:
        for i in range(snake_case_       ,len(snake_case_		)		):
            __A					:		Tuple						=  collection[i]
            __A					:		Union[str, Any]						=  i
            while j >= gap and collection[j - gap] > insert_value:
                __A					:		Optional[int]						=  collection[j - gap]
                j -= gap
            if j != i:
                __A					:		Optional[int]						=  insert_value
    return collection


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

       testmod()
       a_				=    input("""Enter numbers separated by a comma:\n""").strip()
       a_				=    [int(item) for item in user_input.split(""",""")]
       print(shell_sort(unsorted))




