


'''simple docstring'''
import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
    print("""Googling.....""")
    lowerCAmelCase						=					"""https://www.google.com/search?q=""" + """ """.join(sys.argv[1:])
    lowerCAmelCase						=					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(10_000):
            out_file.write(data)
    lowerCAmelCase						=					BeautifulSoup(res.text, """html.parser""")
    lowerCAmelCase						=					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")}')









'''simple docstring'''
class        lowerCAmelCase_  :






       def __init__( self			,     _UpperCamelCase   )->      None:
            _A				=							size
            _A				=							[0] * size
            _A				=							[0] * size






       @staticmethod
       def   UpperCamelCase						( _UpperCamelCase   )->      int:
            return index | (index + 1)






       @staticmethod
       def   UpperCamelCase						( _UpperCamelCase   )->      int:
            return (index & (index + 1)) - 1






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase   )->      None:
            _A				=							value
            while index < self.size:
                 _A				=							self.get_prev(_UpperCamelCase   ) + 1
                 if current_left_border == index:
                      _A				=							value
                 else:
                      _A				=							max(_UpperCamelCase			,     _UpperCamelCase			,     _UpperCamelCase   )
                 _A				=							self.get_next(_UpperCamelCase   )






       def   UpperCamelCase						( self			,     _UpperCamelCase			,     _UpperCamelCase   )->      int:
            right -= 1  # Because of right is exclusive
            _A				=							0
            while left <= right:
                 _A				=							self.get_prev(_UpperCamelCase   )
                 if left <= current_left:
                      _A				=							max(_UpperCamelCase			,     self.tree[right]   )
                      _A				=							current_left
                 else:
                      _A				=							max(_UpperCamelCase			,     self.arr[right]   )
                      right -= 1
            return result


if __name__ == "__main__":
    import doctest

    doctest.testmod()





