


from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

A   :					int	=      TypeVar("KEY")
A   :					Any	=      TypeVar("VAL")







@dataclass(frozen=lowercase__							,						slots=lowercase__)
class     _lowercase				(							Generic[KEY, VAL]):


       """simple docstring"""




       A__      		=    42
       A__      		=    42







class     _lowercase				(							_Item):


       """simple docstring"""




       def __init__(     self							:    Tuple ):


             '''simple docstring'''



             super().__init__(_UpperCAmelCase      ,   _UpperCAmelCase )





       def __bool__(     self							:    List[Any] ):


             '''simple docstring'''



             return False



A   :					Any	=      _DeletedItem()







class     _lowercase				(							MutableMapping[KEY, VAL]):


       """simple docstring"""




       def __init__(     self							:    Tuple      ,   __lowerCamelCase							:    int = 8      ,   __lowerCamelCase							:    float = 0.7_5 ):


             '''simple docstring'''



             lowerCamelCase__	:       Union[str, Any]					=						initial_block_size
             lowerCamelCase__	:       int					=						[None] * initial_block_size
             assert 0.0 < capacity_factor < 1.0
             lowerCamelCase__	:       Tuple					=						capacity_factor
             lowerCamelCase__	:       List[Any]					=						0





       def 		lowerCAmelCase  (     self							:    Optional[Any]      ,   __lowerCamelCase							:    KEY ):


             '''simple docstring'''



             return hash(_UpperCAmelCase ) % len(self._buckets )





       def 		lowerCAmelCase  (     self							:    Dict      ,   __lowerCamelCase							:    int ):


             '''simple docstring'''



             return (ind + 1) % len(self._buckets )





       def 		lowerCAmelCase  (     self							:    Dict      ,   __lowerCamelCase							:    int      ,   __lowerCamelCase							:    KEY      ,   __lowerCamelCase							:    VAL ):


             '''simple docstring'''



             lowerCamelCase__	:       str					=						self._buckets[ind]
             if not stored:
                   lowerCamelCase__	:       Optional[int]					=						_Item(_UpperCAmelCase      ,   _UpperCAmelCase )
                   self._len += 1
                   return True
             elif stored.key == key:
                   lowerCamelCase__	:       str					=						_Item(_UpperCAmelCase      ,   _UpperCAmelCase )
                   return True
             else:
                   return False





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


             '''simple docstring'''



             lowerCamelCase__	:       Optional[Any]					=						len(self._buckets ) * self._capacity_factor
             return len(self ) >= int(_UpperCAmelCase )





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


             '''simple docstring'''



             if len(self._buckets ) <= self._initial_block_size:
                   return False
             lowerCamelCase__	:       Optional[int]					=						len(self._buckets ) * self._capacity_factor / 2
             return len(self ) < limit





       def 		lowerCAmelCase  (     self							:    List[Any]      ,   __lowerCamelCase							:    int ):


             '''simple docstring'''



             lowerCamelCase__	:       Optional[int]					=						self._buckets
             lowerCamelCase__	:       int					=						[None] * new_size
             lowerCamelCase__	:       str					=						0
             for item in old_buckets:
                   if item:
                         self._add_item(item.key      ,   item.val )





       def 		lowerCAmelCase  (     self							:    Optional[int] ):


             '''simple docstring'''



             self._resize(len(self._buckets ) * 2 )





       def 		lowerCAmelCase  (     self							:    str ):


             '''simple docstring'''



             self._resize(len(self._buckets ) // 2 )





       def 		lowerCAmelCase  (     self							:    List[str]      ,   __lowerCamelCase							:    KEY ):


             '''simple docstring'''



             lowerCamelCase__	:       List[Any]					=						self._get_bucket_index(_UpperCAmelCase )
             for _ in range(len(self._buckets ) ):
                   yield ind
                   lowerCamelCase__	:       Dict					=						self._get_next_ind(_UpperCAmelCase )





       def 		lowerCAmelCase  (     self							:    int      ,   __lowerCamelCase							:    KEY      ,   __lowerCamelCase							:    VAL ):


             '''simple docstring'''



             for ind in self._iterate_buckets(_UpperCAmelCase ):
                   if self._try_set(_UpperCAmelCase      ,   _UpperCAmelCase      ,   _UpperCAmelCase ):
                         break





       def __setitem__(     self							:    List[str]      ,   __lowerCamelCase							:    KEY      ,   __lowerCamelCase							:    VAL ):


             '''simple docstring'''



             if self._is_full():
                   self._size_up()

             self._add_item(_UpperCAmelCase      ,   _UpperCAmelCase )





       def __delitem__(     self							:    Any      ,   __lowerCamelCase							:    KEY ):


             '''simple docstring'''



             for ind in self._iterate_buckets(_UpperCAmelCase ):
                   lowerCamelCase__	:       List[Any]					=						self._buckets[ind]
                   if item is None:
                         raise KeyError(_UpperCAmelCase )
                   if item is _deleted:
                         continue
                   if item.key == key:
                         lowerCamelCase__	:       Optional[int]					=						_deleted
                         self._len -= 1
                         break
             if self._is_sparse():
                   self._size_down()





       def __getitem__(     self							:    int      ,   __lowerCamelCase							:    KEY ):


             '''simple docstring'''



             for ind in self._iterate_buckets(_UpperCAmelCase ):
                   lowerCamelCase__	:       Dict					=						self._buckets[ind]
                   if item is None:
                         break
                   if item is _deleted:
                         continue
                   if item.key == key:
                         return item.val
             raise KeyError(_UpperCAmelCase )





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


             '''simple docstring'''



             return self._len





       def __iter__(     self							:    Optional[Any] ):


             '''simple docstring'''



             yield from (item.key for item in self._buckets if item)





       def __repr__(     self							:    Tuple ):


             '''simple docstring'''



             lowerCamelCase__	:       Any					=						" ,".join(
                 f"{item.key}: {item.val}" for item in self._buckets if item )
             return f"HashMap({val_string})"






import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
    print("Googling.....")
    A   :					str	=      "https://www.google.com/search?q=" + " ".join(sys.argv[1:])
    A   :					Optional[int]	=      requests.get(url, headers={"UserAgent": UserAgent().random})
    # res.raise_for_status()
    with open("project1a.html", "wb") as out_file:  # only for knowing the class
        for data in res.iter_content(10000):
            out_file.write(data)
    A   :					int	=      BeautifulSoup(res.text, "html.parser")
    A   :					Any	=      list(soup.select(".eZt8xd"))[:5]

    print(len(links))
    for link in links:
        if link.text == "Maps":
            webbrowser.open(link.get("href"))
        else:
            webbrowser.open(f'https://google.com{link.get("href")}')


