


from __future__ import annotations

import sys
from collections import deque
from typing import Generic, TypeVar

lowerCAmelCase__    :Union[str, Any]       =				TypeVar('''T''')

class 						__a (							Generic[T]     ):
		_a      :    deque[T]  # Cache store of keys
		_a      :    set[T]  # References of the keys in cache
		_a      :    int           =      10  # Maximum capacity of cache
		def __init__(     self     ,       _SCREAMING_SNAKE_CASE		)					->			None:




									"""simple docstring"""





									_UpperCAmelCase											=     deque()
									_UpperCAmelCase											=     set()
									if not n:
																_UpperCAmelCase											=     sys.maxsize
									elif n < 0:
																raise ValueError('n should be an integer greater than 0.'		)
									else:
																_UpperCAmelCase											=     n
		def       UpperCAmelCase__							(     self     ,       _SCREAMING_SNAKE_CASE		)					->			None:




									"""simple docstring"""





									if x not in self.key_reference:
																if len(self.dq_store		) == LRUCache._MAX_CAPACITY:
																							_UpperCAmelCase											=     self.dq_store.pop()
																							self.key_reference.remove(_lowercase		)
									else:
																self.dq_store.remove(_lowercase		)

									self.dq_store.appendleft(_lowercase		)
									self.key_reference.add(_lowercase		)
		def       UpperCAmelCase__							(     self		)					->			None:




									"""simple docstring"""





									for k in self.dq_store:
																print(_lowercase		)






		def __repr__(     self		)					->			str:




									"""simple docstring"""





									return f'''LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store		)}'''


if __name__ == "__main__":
		import doctest

		doctest.testmod()

		lowerCAmelCase__    :LRUCache[str | int]       =				LRUCache(4)
		lru_cache.refer('''A''')
		lru_cache.refer(2)
		lru_cache.refer(3)
		lru_cache.refer('''A''')
		lru_cache.refer(4)
		lru_cache.refer(5)
		lru_cache.display()

		print(lru_cache)
		assert str(lru_cache) == "LRUCache(4) => [5, 4, 'A', 3]"



import math


def 					_UpperCAmelCase				(						a__ = 1_0_0):

			'''simple docstring'''



			a_						:						List[str] 							= sum(i * i for i in range(1  ,	n + 1))
			a_						:						Optional[Any] 							= int(math.pow(sum(range(1  ,	n + 1))  ,	2))
			return square_of_sum - sum_of_squares


if __name__ == "__main__":
	print(F"""{solution() = }""")


