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

    print("""Googling.....""")

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

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

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

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

    webbrowser.open(link)

"""simple docstring"""


from __future__ import annotations






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return [ord(lowercase		) - 96 for elem in plain]






def     __UpperCAmelCase					(			lowercase		):







  """simple docstring"""
  return "".join(chr(elem + 96		) for elem in encoded		)






def     __UpperCAmelCase					(			):







  """simple docstring"""
  _UpperCAmelCase						 =      encode(input("""-> """		).strip().lower()		)
  print("""Encoded: """   ,lowercase		)
  print("""Decoded:"""   ,decode(lowercase		)		)


if __name__ == "__main__":
    main()
