



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

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

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

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

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

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

				webbrowser.open(link)









def 					__lowerCAmelCase		(  )  ->						Tuple:
					__lowerCAmelCase	   =[]
					__lowerCAmelCase	   =1

					while len(__lowerCamelCase	) < 1E6:
										constant.append(str(__lowerCamelCase	)	)
										i += 1

					__lowerCAmelCase	   ="""""".join(__lowerCamelCase	)

					return (
					    int(constant[0]	)
					    * int(constant[9]	)
					    * int(constant[99]	)
					    * int(constant[999]	)
					    * int(constant[9999]	)
					    * int(constant[99999]	)
					    * int(constant[999999]	)
					)


if __name__ == "__main__":
				print(solution())




