





from __future__ import annotations

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

_UpperCAmelCase       : Any			     =       TypeVar("""T""")

class      lowerCAmelCase							(      Generic[T]    ):
 UpperCAmelCase__									=	42  # Cache store of keys
 UpperCAmelCase__									=	42  # References of the keys in cache
 UpperCAmelCase__									=	10  # Maximum capacity of cache
 def __init__(   self						:   Optional[Any]    ,  UpperCAmelCase						:   int			)    ->			None:
     lowerCamelCase__					:   str      				=	deque()
     lowerCamelCase__					:   List[Any]      				=	set()
     if not n:
         lowerCamelCase__					:   List[Any]      				=	sys.maxsize
     elif n < 0:
         raise ValueError('n should be an integer greater than 0.'			)
     else:
         lowerCamelCase__					:   int      				=	n
 def   A_			(   self						:   List[Any]    ,  UpperCAmelCase						:   T			)    ->			None:
     if x not in self.key_reference:
         if len(self.dq_store			) == LRUCache._MAX_CAPACITY:
             lowerCamelCase__					:   Optional[int]      				=	self.dq_store.pop()
             self.key_reference.remove(UpperCAmelCase			)
     else:
         self.dq_store.remove(UpperCAmelCase			)

     self.dq_store.appendleft(UpperCAmelCase			)
     self.key_reference.add(UpperCAmelCase			)
 def   A_			(   self						:   Tuple			)    ->			None:
     for k in self.dq_store:
         print(UpperCAmelCase			)







 def __repr__(   self						:   List[str]			)    ->			str:
     return F"""LRUCache({self._MAX_CAPACITY}) => {list(self.dq_store			)}"""


if __name__ == "__main__":
    import doctest

    doctest.testmod()

    _UpperCAmelCase       : 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]"












from __future__ import annotations

from collections.abc import Generator


def  SCREAMING_SNAKE_CASE   ( )    ->  Generator[int, None, None]:
    lowerCamelCase__					:   dict[int, int]      				=	{}
    lowerCamelCase__					:   Union[str, Any]      				=	2
    while True:
        lowerCamelCase__					:   Optional[int]      				=	factor_map.pop(_UpperCAmelCase		,			_UpperCAmelCase				)
        if factor:
            lowerCamelCase__					:   Optional[Any]      				=	factor + prime
            while x in factor_map:
                x += factor
            lowerCamelCase__					:   Optional[Any]      				=	factor
        else:
            lowerCamelCase__					:   Union[str, Any]      				=	prime
            yield prime
        prime += 1


def  SCREAMING_SNAKE_CASE   ( _UpperCAmelCase = 1e10				)    ->  int:
    lowerCamelCase__					:   Tuple      				=	sieve()

    lowerCamelCase__					:   Dict      				=	1
    while True:
        lowerCamelCase__					:   List[Any]      				=	next(_UpperCAmelCase				)
        if (2 * prime * n) > limit:
            return n
        # Ignore the next prime as the reminder will be 2.
        next(_UpperCAmelCase				)
        n += 2


if __name__ == "__main__":
    print(solution())





