"""simple docstring"""







from __future__ import annotations

from collections.abc import Iterable, Iterator
from typing import Any, Generic, TypeVar

UpperCamelCase_       :       int							   =		TypeVar("""T""", bound=bool)


class 			_lowercase		(   Generic[T]  ):

				def __init__(     self       :    Dict       ,    _lowercase       :    T     ):


										'''simple docstring'''
										UpperCAmelCase__						=		value
										UpperCAmelCase__						=		None
										UpperCAmelCase__						=		None

				@property
				def        A (     self       :    str     ):


										'''simple docstring'''
										return self._value

				@staticmethod
				def        A (     _lowercase       :    SkewNode[T] | None       ,    _lowercase       :    SkewNode[T] | None     ):


										'''simple docstring'''
										if not roota:
																return roota

										if not roota:
																return roota

										if roota.value > roota.value:
																UpperCAmelCase__	,      UpperCAmelCase__						=		roota, roota

										UpperCAmelCase__						=		roota
										UpperCAmelCase__						=		roota.right
										UpperCAmelCase__						=		roota.left
										UpperCAmelCase__						=		SkewNode.merge(_lowercase       ,    _lowercase     )

										return result


class 			_lowercase		(   Generic[T]  ):

				def __init__(     self       :    Any       ,    _lowercase       :    Iterable[T] | None = ()     ):


										'''simple docstring'''
										UpperCAmelCase__						=		None
										if data:
																for item in data:
																						self.insert(_lowercase     )

				def __bool__(     self       :    Tuple     ):


										'''simple docstring'''
										return self._root is not None

				def __iter__(     self       :    int     ):


										'''simple docstring'''
										UpperCAmelCase__						=		[]
										while self:
																result.append(self.pop()     )

										# Pushing items back to the heap not to clear it.
										for item in result:
																self.insert(_lowercase     )

										return iter(_lowercase     )

				def        A (     self       :    Tuple       ,    _lowercase       :    T     ):


										'''simple docstring'''
										UpperCAmelCase__						=		SkewNode.merge(self._root       ,    SkewNode(_lowercase     )     )

				def        A (     self       :    Optional[int]     ):


										'''simple docstring'''
										UpperCAmelCase__						=		self.top()
										UpperCAmelCase__						=		(
										    SkewNode.merge(self._root.left       ,    self._root.right     ) if self._root else None
										)

										return result

				def        A (     self       :    int     ):


										'''simple docstring'''
										if not self._root:
																raise IndexError("""Can't get top element for the empty heap."""     )
										return self._root.value

				def        A (     self       :    Union[str, Any]     ):


										'''simple docstring'''
										UpperCAmelCase__						=		None


if __name__ == "__main__":
						import doctest

						doctest.testmod()


"""simple docstring"""







from __future__ import annotations

import sys


def   a__      (		UpperCAmelCase__       :			int			)->	int:
						if n < 0:
												raise ValueError("""Negative arguments are not supported"""			)
						return _fib(UpperCAmelCase__			)[0]


def   a__      (		UpperCAmelCase__       :			int			)->	tuple[int, int]:
						if n == 0:  # (F(0), F(1))
												return (0, 1)

						# F(2n) = F(n)[2F(n+1) − F(n)]
						# F(2n+1) = F(n+1)^2+F(n)^2
						UpperCAmelCase__	,      UpperCAmelCase__						=		_fib(n // 2			)
						UpperCAmelCase__						=		a * (b * 2 - a)
						UpperCAmelCase__						=		a * a + b * b
						return (d, c + d) if n % 2 else (c, d)


if __name__ == "__main__":
						UpperCamelCase_       :       int							   =		int(sys.argv[1])
						print(F"""fibonacci({n}) is {fibonacci(n)}""")

