



from __future__ import annotations

from collections import deque
from collections.abc import Iterator
from dataclasses import dataclass


@dataclass
class   __lowerCAmelCase  :
					"""simple docstring"""






					A__					:		int
					A__					:		int







class   __lowerCAmelCase  :
					"""simple docstring"""






					def __init__(  self       :							Any					,       _snake_case       :							int       ):






								"""simple docstring"""


								A__	  =     [[] for _ in range(_snake_case       )]
								A__	  =     size



					def __getitem__(  self       :							Union[str, Any]					,       _snake_case       :							int       ):






								"""simple docstring"""


								return iter(self._graph[vertex]       )



					@property
					def      _a				(  self       :							Any       ):






								"""simple docstring"""


								return self._size



					def      _a				(  self       :							Optional[int]					,       _snake_case       :							int					,       _snake_case       :							int					,       _snake_case       :							int       ):






								"""simple docstring"""


								if weight not in (0, 1):
											raise ValueError('Edge weight must be either 0 or 1.'       )

								if to_vertex < 0 or to_vertex >= self.size:
											raise ValueError('Vertex indexes must be in [0; size).'       )

								self._graph[from_vertex].append(Edge(_snake_case					,       _snake_case       )       )



					def      _a				(  self       :							int					,       _snake_case       :							int					,       _snake_case       :							int       ):






								"""simple docstring"""


								A__	  =     deque([start_vertex]       )
								A__	  =     [None] * self.size
								A__	  =     0

								while queue:
											A__	  =     queue.popleft()
											A__	  =     distances[current_vertex]
											if current_distance is None:
														continue

											for edge in self[current_vertex]:
														A__	  =     current_distance + edge.weight
														A__	  =     distances[edge.destination_vertex]
														if (
														    isinstance(_snake_case					,       _snake_case       )
														    and new_distance >= dest_vertex_distance
														):
																	continue
														A__	  =     new_distance
														if edge.weight == 0:
																	queue.appendleft(edge.destination_vertex       )
														else:
																	queue.append(edge.destination_vertex       )

								if distances[finish_vertex] is None:
											raise ValueError('No path from start_vertex to finish_vertex.'       )

								return distances[finish_vertex]


if __name__ == "__main__":
							import doctest

							doctest.testmod()









from __future__ import annotations

from typing import Any


def A    (							__UpperCamelCase       )    ->   int:
			if not postfix_notation:
						return 0

			A__	  =     {'+', '-', '*', '/'}
			A__	  =     []

			for token in postfix_notation:
						if token in operations:
									A__  ,			A__	  =     stack.pop(), stack.pop()
									if token == "+":
												stack.append(a + b       )
									elif token == "-":
												stack.append(a - b       )
									elif token == "*":
												stack.append(a * b       )
									else:
												if a * b < 0 and a % b != 0:
															stack.append(a // b + 1       )
												else:
															stack.append(a // b       )
						else:
									stack.append(int(__UpperCamelCase       )       )

			return stack.pop()


if __name__ == "__main__":
							import doctest

							doctest.testmod()




