





def 							__snake_case							(    lowerCAmelCase_ ,							lowerCAmelCase_	)				->						int:
    while a != 0:
        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			b % a, a
    return b



def 							__snake_case							(    lowerCAmelCase_ ,							lowerCAmelCase_	)				->						int:
    if gcd(lowerCAmelCase_ ,							lowerCAmelCase_	) != 1:
        SCREAMING_SNAKE_CASE__											=			f'''mod inverse of {a!r} and {m!r} does not exist'''
        raise ValueError(lowerCAmelCase_	)
    SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			1, 0, a
    SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			0, 1, m
    while va != 0:
        SCREAMING_SNAKE_CASE__											=			ua // va
        SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__				,		SCREAMING_SNAKE_CASE__											=			(ua - q * va), (ua - q * va), (ua - q * va), va, va, va
    return ua % m






'''simple docstring'''





from typing import Any

class   _a							:






     def __init__(					self   ,_SCREAMING_SNAKE_CASE       )				->     List[str]:
          _snake_case				= data
          _snake_case				= None







class   _a							:






     def __init__(					self       )				->     List[Any]:
          _snake_case				= None






     def 							_lowercase      (					self       )				->     str:
          _snake_case				= self.head
          while temp is not None:
               print(temp.data   ,end=" "       )
               _snake_case				= temp.next
          print()






     def 							_lowercase      (					self   ,_SCREAMING_SNAKE_CASE       )				->     Dict:
          _snake_case				= Node(_SCREAMING_SNAKE_CASE       )
          _snake_case				= self.head
          _snake_case				= new_node






     def 							_lowercase      (					self   ,_SCREAMING_SNAKE_CASE   ,_SCREAMING_SNAKE_CASE       )				->     Tuple:
          if node_data_a == node_data_a:
               return
          else:
               _snake_case				= self.head
               while node_a is not None and node_a.data != node_data_a:
                    _snake_case				= node_a.next

               _snake_case				= self.head
               while node_a is not None and node_a.data != node_data_a:
                    _snake_case				= node_a.next

               if node_a is None or node_a is None:
                    return

               _snake_case				,   _snake_case				= node_a.data, node_a.data


if __name__ == "__main__":
   UpperCamelCase_		:     str          =		LinkedList()
   for i in range(5, 0, -1):
      ll.push(i)

   ll.print_list()

   ll.swap_nodes(1, 4)
   print('''After swapping''')
   ll.print_list()


