

'''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__":
 lowerCAmelCase__											=	'''%20'''.join(argv[1:]) if len(argv) > 1 else quote(str(input('''Search: ''')))

 print('''Googling.....''')

 lowerCAmelCase__											=	f'https://www.google.com/search?q={query}&num=100'

 lowerCAmelCase__											=	requests.get(
     url,
     headers={'''User-Agent''': str(UserAgent().random)},
 )

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

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

 webbrowser.open(link)





def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      while a != 0:
            lowerCamelCase__    ,   lowerCamelCase__		:				Optional[Any]    =  b % a, a
      return b


def       lowercase_		(		_A			:    int    ,					_A			:    int						):

      """simple docstring"""




      if gcd(_A    ,					_A						) != 1:
            lowerCamelCase__		:				List[str]    =  F"mod inverse of {a!r} and {m!r} does not exist"
            raise ValueError(_A						)
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Tuple    =  1, 0, a
      lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				Optional[int]    =  0, 1, m
      while va != 0:
            lowerCamelCase__		:				Tuple    =  ua // va
            lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__    ,   lowerCamelCase__		:				str    =  (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
      return ua % m


