


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

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

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

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

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

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

		webbrowser.open(link)
"""simple docstring"""


import math






def 			__UpperCAmelCase    (	lowercase						):







  """simple docstring"""
  _UpperCAmelCase         =					[]
  _UpperCAmelCase         =					2
  _UpperCAmelCase         =					int(math.sqrt(lowercase						)						)  # Size of every segment
  _UpperCAmelCase         =					[True] * (end + 1)
  _UpperCAmelCase         =					[]

  while start <= end:
    if temp[start] is True:
      in_prime.append(lowercase						)
      for i in range(start * start      ,end + 1      ,lowercase						):
        _UpperCAmelCase         =					False
    start += 1
  prime += in_prime

  _UpperCAmelCase         =					end + 1
  _UpperCAmelCase         =					min(2 * end      ,lowercase						)

  while low <= n:
    _UpperCAmelCase         =					[True] * (high - low + 1)
    for each in in_prime:
      _UpperCAmelCase         =					math.floor(low / each						) * each
      if t < low:
        t += each

      for j in range(lowercase      ,high + 1      ,lowercase						):
        _UpperCAmelCase         =					False

    for j in range(len(lowercase						)						):
      if temp[j] is True:
        prime.append(j + low						)

    _UpperCAmelCase         =					high + 1
    _UpperCAmelCase         =					min(high + end      ,lowercase						)

  return prime

print(sieve(1_0**6))
