




import sys
import webbrowser

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
   print('Googling.....')
   lowerCamelCase__ :   List[Any]					=							'https://www.google.com/search?q=' + ' '.join(sys.argv[1:])
   lowerCamelCase__ :   List[Any]					=							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__ :   int					=							BeautifulSoup(res.text, 'html.parser')
   lowerCamelCase__ :   List[str]					=							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')}''')





from __future__ import annotations

lowerCamelCase__ :   Optional[int]					=							[-10, -5, 0, 5, 5.1, 11, 13, 21, 3, 4, -21, -10, -5, -1, 0]
lowerCamelCase__ :   List[Any]					=							[-5, 0, 5, 5.1, 11, 13, 21, -1, 4, -1, -10, -5, -1, 0, -1]

def 					UpperCAmelCase_							(      __UpperCAmelCase						:	list[float]							)					-> list[float]:
      SCREAMING_SNAKE_CASE_							=			[]
      SCREAMING_SNAKE_CASE_							=			len(__UpperCAmelCase							)

      for i in range(__UpperCAmelCase							):
            SCREAMING_SNAKE_CASE_							=			-1
            for j in range(i + 1			,			__UpperCAmelCase							):
                  if arr[i] < arr[j]:
                        SCREAMING_SNAKE_CASE_							=			arr[j]
                        break
            result.append(__UpperCAmelCase							)
      return result

def 					UpperCAmelCase_							(      __UpperCAmelCase						:	list[float]							)					-> list[float]:
      SCREAMING_SNAKE_CASE_							=			[]
      for i, outer in enumerate(__UpperCAmelCase							):
            SCREAMING_SNAKE_CASE_							=			-1
            for inner in arr[i + 1 :]:
                  if outer < inner:
                        SCREAMING_SNAKE_CASE_							=			inner
                        break
            result.append(__UpperCAmelCase							)
      return result

def 					UpperCAmelCase_							(      __UpperCAmelCase						:	list[float]							)					-> list[float]:
      SCREAMING_SNAKE_CASE_							=			len(__UpperCAmelCase							)
      SCREAMING_SNAKE_CASE_							=			[]
      SCREAMING_SNAKE_CASE_							=			[-1] * arr_size

      for index in reversed(range(__UpperCAmelCase							)							):
            if stack:
                  while stack[-1] <= arr[index]:
                        stack.pop()
                        if not stack:
                              break
            if stack:
                  SCREAMING_SNAKE_CASE_							=			stack[-1]
            stack.append(arr[index]							)
      return result


if __name__ == "__main__":
   from doctest import testmod
   from timeit import timeit

   testmod()
   print(next_greatest_element_slow(arr))
   print(next_greatest_element_fast(arr))
   print(next_greatest_element(arr))

   lowerCamelCase__ :   List[str]					=							(
       'from __main__ import arr, next_greatest_element_slow, '
       'next_greatest_element_fast, next_greatest_element'
   )
   print(
       'next_greatest_element_slow():',
       timeit('next_greatest_element_slow(arr)', setup=setup),
   )
   print(
       'next_greatest_element_fast():',
       timeit('next_greatest_element_fast(arr)', setup=setup),
   )
   print(
       '     next_greatest_element():',
       timeit('next_greatest_element(arr)', setup=setup),
   )