



"""simple docstring"""
import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
       UpperCAmelCase						:		str			= "%20".join(argv[1:]) if len(argv) > 1 else quote(str(input("Search: ")))

       print("Googling.....")

       UpperCAmelCase						:		int			= F"https://www.google.com/search?q={query}&num=100"

       UpperCAmelCase						:		Any			= requests.get(
           url,
           headers={"User-Agent": str(UserAgent().random)},
       )

       try:
              UpperCAmelCase						:		str			= (
                  BeautifulSoup(res.text, "html.parser")
                  .find("div", attrs={"class": "yuRUbf"})
                  .find("a")
                  .get("href")
              )

       except AttributeError:
              UpperCAmelCase						:		Optional[Any]			= parse_qs(
                  BeautifulSoup(res.text, "html.parser")
                  .find("div", attrs={"class": "kCrYT"})
                  .find("a")
                  .get("href")
              )["url"][0]

       webbrowser.open(link)






"""simple docstring"""
def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						int:







  '''simple docstring'''


  while a != 0:
    lowercase_					,    lowercase_								= b % a, a
  return b


def 			_SCREAMING_SNAKE_CASE						(__lowerCAmelCase ,  __lowerCAmelCase							) ->						int:







  '''simple docstring'''


  if gcd(__lowerCAmelCase ,  __lowerCAmelCase							) != 1:
    lowercase_								= F'''mod inverse of {a!r} and {m!r} does not exist'''
    raise ValueError(__lowerCAmelCase							)
  lowercase_					,    lowercase_					,    lowercase_								= 1, 0, a
  lowercase_					,    lowercase_					,    lowercase_								= 0, 1, m
  while va != 0:
    lowercase_								= ua // va
    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_					,    lowercase_								= (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
  return ua % m

