


import math



def     __lowerCAmelCase						(							snake_case	:    int )       ->							list[int]:
   __lowerCamelCase:				Union[str, Any]     =	[]
   __lowerCamelCase:				Dict     =	2
   __lowerCamelCase:				Optional[Any]     =	int(math.sqrt(snake_case ) )  # Size of every segment
   __lowerCamelCase:				Union[str, Any]     =	[True] * (end + 1)
   __lowerCamelCase:				int     =	[]

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

   __lowerCamelCase:				Union[str, Any]     =	end + 1
   __lowerCamelCase:				int     =	min(2 * end						,      snake_case )

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

         for j in range(snake_case						,      high + 1						,      snake_case ):
            __lowerCamelCase:				List[str]     =	False

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

      __lowerCamelCase:				Any     =	high + 1
      __lowerCamelCase:				Union[str, Any]     =	min(high + end						,      snake_case )

   return prime







print(sieve(10**6))






_A		:				Tuple									=       '''ABCDEFGHIJKLMNOPQRSTUVWXYZ'''



def     __lowerCAmelCase						(							)       ->							None:
   __lowerCamelCase:				Optional[int]     =	input("""Enter message: """ )
   __lowerCamelCase:				Dict     =	input("""Enter key [alphanumeric]: """ )
   __lowerCamelCase:				List[Any]     =	input("""Encrypt/Decrypt [e/d]: """ )

   if mode.lower().startswith("""e""" ):
      __lowerCamelCase:				Optional[int]     =	"""encrypt"""
      __lowerCamelCase:				Optional[int]     =	encrypt_message(snake_case						,      snake_case )
   elif mode.lower().startswith("""d""" ):
      __lowerCamelCase:				Union[str, Any]     =	"""decrypt"""
      __lowerCamelCase:				Optional[Any]     =	decrypt_message(snake_case						,      snake_case )

   print(f'\n{mode.title()}ed message:' )
   print(snake_case )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							str:
   return translate_message(snake_case						,      snake_case						,      """encrypt""" )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str )       ->							str:
   return translate_message(snake_case						,      snake_case						,      """decrypt""" )



def     __lowerCAmelCase						(							snake_case	:    str						,      snake_case	:    str						,      snake_case	:    str )       ->							str:
   __lowerCamelCase:				Any     =	[]
   __lowerCamelCase:				Optional[int]     =	0
   __lowerCamelCase:				Any     =	key.upper()

   for symbol in message:
      __lowerCamelCase:				int     =	LETTERS.find(symbol.upper() )
      if num != -1:
         if mode == "encrypt":
            num += LETTERS.find(key[key_index] )
         elif mode == "decrypt":
            num -= LETTERS.find(key[key_index] )

         num %= len(snake_case )

         if symbol.isupper():
            translated.append(LETTERS[num] )
         elif symbol.islower():
            translated.append(LETTERS[num].lower() )

         key_index += 1
         if key_index == len(snake_case ):
            __lowerCamelCase:				Union[str, Any]     =	0
      else:
         translated.append(snake_case )
   return "".join(snake_case )


if __name__ == "__main__":
   main()


