




from collections import deque




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Optional[Any]      )  ->							Union[str, Any]:
    return input(__UpperCamelCase      ).strip().split(''' '''      )




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						int       ,     __UpperCamelCase			:						int      )  ->							dict[int, list[int]]:
    UpperCAmelCase_							 =     {}
    for i in range(__UpperCamelCase      ):
        UpperCAmelCase_							 =     []

    for e in range(__UpperCamelCase      ):
        UpperCAmelCase_ ,							UpperCAmelCase_							 =     (int(__UpperCamelCase      ) for i in _input(f'Edge {e + 1}: <node1> <node2> '      ))
        graph[x].append(__UpperCamelCase      )
    return graph




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						int       ,     __UpperCamelCase			:						int      )  ->							dict[int, list[int]]:
    UpperCAmelCase_							 =     {}
    for i in range(__UpperCamelCase      ):
        UpperCAmelCase_							 =     []

    for e in range(__UpperCamelCase      ):
        UpperCAmelCase_ ,							UpperCAmelCase_							 =     (int(__UpperCamelCase      ) for i in _input(f'Edge {e + 1}: <node1> <node2> '      ))
        graph[x].append(__UpperCamelCase      )
        graph[y].append(__UpperCamelCase      )
    return graph




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						int       ,     __UpperCamelCase			:						int      )  ->							dict[int, list[tuple[int, int]]]:
    UpperCAmelCase_							 =     {}
    for i in range(__UpperCamelCase      ):
        UpperCAmelCase_							 =     []

    for e in range(__UpperCamelCase      ):
        UpperCAmelCase_ ,							UpperCAmelCase_ ,							UpperCAmelCase_							 =     (int(__UpperCamelCase      ) for i in _input(f'Edge {e + 1}: <node1> <node2> <weight> '      ))
        graph[x].append((y, w)      )
        graph[y].append((x, w)      )
    return graph


if __name__ == "__main__":
 _lowerCamelCase ,     _lowerCamelCase			 =						(int(i) for i in _input('Number of nodes and edges: '))

 _lowerCamelCase			 =						int(
     _input(
         'Press 1 or 2 or 3 \n'
         '1. Unweighted directed \n'
         '2. Unweighted undirected \n'
         '3. Weighted undirected \n'
     )[0]
 )

 _lowerCamelCase			 =						{
     1: initialize_unweighted_directed_graph,
     2: initialize_unweighted_undirected_graph,
     3: initialize_weighted_undirected_graph,
 }[graph_choice](n, m)




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Tuple       ,     __UpperCamelCase			:						Optional[int]      )  ->							Tuple:
    UpperCAmelCase_ ,							UpperCAmelCase_							 =     {s}, [s]
    print(__UpperCamelCase      )
    while _s:
        UpperCAmelCase_							 =     0
        for i in g[_s[-1]]:
            if i not in vis:
                _s.append(__UpperCamelCase      )
                vis.add(__UpperCamelCase      )
                UpperCAmelCase_							 =     1
                print(__UpperCamelCase      )
                break
        if not flag:
            _s.pop()




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						str       ,     __UpperCamelCase			:						List[str]      )  ->							Dict:
    UpperCAmelCase_ ,							UpperCAmelCase_							 =     {s}, deque([s]      )
    print(__UpperCamelCase      )
    while q:
        UpperCAmelCase_							 =     q.popleft()
        for v in g[u]:
            if v not in vis:
                vis.add(__UpperCamelCase      )
                q.append(__UpperCamelCase      )
                print(__UpperCamelCase      )




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Union[str, Any]       ,     __UpperCamelCase			:						List[str]      )  ->							List[str]:
    UpperCAmelCase_ ,							UpperCAmelCase_ ,							UpperCAmelCase_							 =     {s: 0}, set(), {s: 0}
    while True:
        if len(__UpperCamelCase      ) == len(__UpperCamelCase      ) - 1:
            break
        UpperCAmelCase_							 =     10_0000
        for i in dist:
            if i not in known and dist[i] < mini:
                UpperCAmelCase_							 =     dist[i]
                UpperCAmelCase_							 =     i
        known.add(__UpperCamelCase      )
        for v in g[u]:
            if v[0] not in known and dist[u] + v[1] < dist.get(v[0]       ,     10_0000      ):
                UpperCAmelCase_							 =     dist[u] + v[1]
                UpperCAmelCase_							 =     u
    for i in dist:
        if i != s:
            print(dist[i]      )




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Union[str, Any]       ,     __UpperCamelCase			:						Dict=None       ,     __UpperCamelCase			:						Dict=None      )  ->							List[str]:
    if q is None:
        UpperCAmelCase_							 =     [1]
    if ind is None:
        UpperCAmelCase_							 =     [0] * (len(__UpperCamelCase      ) + 1)  # SInce oth Index is ignored
        for u in g:
            for v in g[u]:
                ind[v] += 1
        UpperCAmelCase_							 =     deque()
        for i in g:
            if ind[i] == 0:
                q.append(__UpperCamelCase      )
    if len(__UpperCamelCase      ) == 0:
        return
    UpperCAmelCase_							 =     q.popleft()
    print(__UpperCamelCase      )
    for w in g[v]:
        ind[w] -= 1
        if ind[w] == 0:
            q.append(__UpperCamelCase      )
    topo(__UpperCamelCase       ,     __UpperCamelCase       ,     __UpperCamelCase      )




def 					SCREAMING_SNAKE_CASE	(       )  ->							str:
    UpperCAmelCase_							 =     input().strip()
    UpperCAmelCase_							 =     []
    for _ in range(__UpperCamelCase      ):
        a.append(map(__UpperCamelCase       ,     input().strip().split()      )      )
    return a, n




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Optional[Any]      )  ->							Optional[Any]:
    ((UpperCAmelCase_) ,							(UpperCAmelCase_))							 =     a_and_n
    UpperCAmelCase_							 =     list(__UpperCamelCase      )
    UpperCAmelCase_							 =     [[0] * n for i in range(__UpperCamelCase      )]
    for k in range(__UpperCamelCase      ):
        for i in range(__UpperCamelCase      ):
            for j in range(__UpperCamelCase      ):
                if dist[i][j] > dist[i][k] + dist[k][j]:
                    UpperCAmelCase_							 =     dist[i][k] + dist[k][j]
                    UpperCAmelCase_							 =     k
    print(__UpperCamelCase      )




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Tuple       ,     __UpperCamelCase			:						Optional[int]      )  ->							Optional[int]:
    UpperCAmelCase_ ,							UpperCAmelCase_ ,							UpperCAmelCase_							 =     {s: 0}, set(), {s: 0}
    while True:
        if len(__UpperCamelCase      ) == len(__UpperCamelCase      ) - 1:
            break
        UpperCAmelCase_							 =     10_0000
        for i in dist:
            if i not in known and dist[i] < mini:
                UpperCAmelCase_							 =     dist[i]
                UpperCAmelCase_							 =     i
        known.add(__UpperCamelCase      )
        for v in g[u]:
            if v[0] not in known and v[1] < dist.get(v[0]       ,     10_0000      ):
                UpperCAmelCase_							 =     v[1]
                UpperCAmelCase_							 =     u
    return dist




def 					SCREAMING_SNAKE_CASE	(       )  ->							Tuple:
    UpperCAmelCase_ ,							UpperCAmelCase_							 =     map(__UpperCamelCase       ,     input().split(''' '''      )      )
    UpperCAmelCase_							 =     []
    for _ in range(__UpperCamelCase      ):
        edges.append(map(__UpperCamelCase       ,     input().split(''' '''      )      )      )
    return edges, n




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						Tuple      )  ->							Any:
    # Sort edges on the basis of distance
    ((UpperCAmelCase_) ,							(UpperCAmelCase_))							 =     e_and_n
    e.sort(reverse=__UpperCamelCase       ,     key=lambda __UpperCamelCase      : x[2]      )
    UpperCAmelCase_							 =     [{i} for i in range(1       ,     n + 1      )]
    while True:
        if len(__UpperCamelCase      ) == 1:
            break
        print(__UpperCamelCase      )
        UpperCAmelCase_							 =     e.pop()
        for i in range(len(__UpperCamelCase      )      ):
            if x[0] in s[i]:
                break
        for j in range(len(__UpperCamelCase      )      ):
            if x[1] in s[j]:
                if i == j:
                    break
                s[j].update(s[i]      )
                s.pop(__UpperCamelCase      )
                break




def 					SCREAMING_SNAKE_CASE	(       __UpperCamelCase			:						int      )  ->							Tuple:
    UpperCAmelCase_							 =     []
    for node in graph:
        if not graph[node]:
            isolated.append(__UpperCamelCase      )
    return isolated






"""simple docstring"""


from ...configuration_utils import PretrainedConfig
from ...utils import logging


a							=logging.get_logger(__name__)

a							={
    'microsoft/mpnet-base': 'https://huggingface.co/microsoft/mpnet-base/resolve/main/config.json',
}






class    __UpperCAmelCase						(	__lowerCAmelCase	):
				A__      :   Optional[int]  							=       '''mpnet'''

				def __init__(      self	, _lowerCamelCase=30527	, _lowerCamelCase=768	, _lowerCamelCase=12	, _lowerCamelCase=12	, _lowerCamelCase=3072	, _lowerCamelCase="gelu"	, _lowerCamelCase=0.1	, _lowerCamelCase=0.1	, _lowerCamelCase=512	, _lowerCamelCase=0.0_2	, _lowerCamelCase=1E-12	, _lowerCamelCase=32	, _lowerCamelCase=1	, _lowerCamelCase=0	, _lowerCamelCase=2	, **_lowerCamelCase	, ):
										super().__init__(pad_token_id=_lowerCamelCase	, bos_token_id=_lowerCamelCase	, eos_token_id=_lowerCamelCase	, **_lowerCamelCase      )

										lowerCamelCase__					=vocab_size
										lowerCamelCase__					=hidden_size
										lowerCamelCase__					=num_hidden_layers
										lowerCamelCase__					=num_attention_heads
										lowerCamelCase__					=hidden_act
										lowerCamelCase__					=intermediate_size
										lowerCamelCase__					=hidden_dropout_prob
										lowerCamelCase__					=attention_probs_dropout_prob
										lowerCamelCase__					=max_position_embeddings
										lowerCamelCase__					=initializer_range
										lowerCamelCase__					=layer_norm_eps
										lowerCamelCase__					=relative_attention_num_buckets


