






from typing import List

import numpy as np






def 						a    (					lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    {key: len(snake_case_       ) for key, value in gen_kwargs.items() if isinstance(snake_case_	,     snake_case_       )}
				if len(set(lists_lengths.values()       )       ) > 1:
								raise RuntimeError(
								    (
								        '''Sharding is ambiguous for this dataset: '''
								        + '''we found several data sources lists of different lengths, and we don\'t know over which list we should parallelize:\n'''
								        + '''\n'''.join(F"""\t- key {key} has length {length}""" for key, length in lists_lengths.items()       )
								        + '''\nTo fix this, check the \'gen_kwargs\' and make sure to use lists only for data sources, '''
								        + '''and use tuples otherwise. In the end there should only be one single list, or several lists with the same length.'''
								    )       )
				lowercase__     				=    max(lists_lengths.values()	,     default=0       )
				return max(1	,     snake_case_       )






def 						a    (					lowerCamelCase_	,     lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    []
				for group_idx in range(snake_case_       ):
								lowercase__     				=    num_shards // max_num_jobs + (group_idx < (num_shards % max_num_jobs))
								if num_shards_to_add == 0:
												break
								lowercase__     				=    shards_indices_per_group[-1].stop if shards_indices_per_group else 0
								lowercase__     				=    range(snake_case_	,     start + num_shards_to_add       )
								shards_indices_per_group.append(snake_case_       )
				return shards_indices_per_group






def 						a    (					lowerCamelCase_	,     lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    _number_of_shards_in_gen_kwargs(snake_case_       )
				if num_shards == 1:
								return [dict(snake_case_       )]
				else:
								lowercase__     				=    _distribute_shards(num_shards=snake_case_	,     max_num_jobs=snake_case_       )
								return [
								    {
								        key: [value[shard_idx] for shard_idx in shard_indices_per_group[group_idx]]
								        if isinstance(snake_case_	,     snake_case_       )
								        else value
								        for key, value in gen_kwargs.items()
								    }
								    for group_idx in range(len(snake_case_       )       )
								]






def 						a    (					lowerCamelCase_       ):






				'''simple docstring'''
				return {
				    key: [value for gen_kwargs in gen_kwargs_list for value in gen_kwargs[key]]
				    if isinstance(gen_kwargs_list[0][key]	,     snake_case_       )
				    else gen_kwargs_list[0][key]
				    for key in gen_kwargs_list[0]
				}






def 						a    (					lowerCamelCase_	,     lowerCamelCase_       ):






				'''simple docstring'''
				lowercase__     				=    {len(snake_case_       ) for value in gen_kwargs.values() if isinstance(snake_case_	,     snake_case_       )}
				lowercase__     				=    {}
				for size in list_sizes:
								lowercase__     				=    list(range(snake_case_       )       )
								rng.shuffle(indices_per_size[size]       )
				# Now let's copy the gen_kwargs and shuffle the lists based on their sizes
				lowercase__     				=    dict(snake_case_       )
				for key, value in shuffled_kwargs.items():
								if isinstance(snake_case_	,     snake_case_       ):
												lowercase__     				=    [value[i] for i in indices_per_size[len(snake_case_       )]]
				return shuffled_kwargs












from functools import reduce

A__			:    Union[str, Any]         =				(
    '73167176531330624919225119674426574742355349194934'
    '96983520312774506326239578318016984801869478851843'
    '85861560789112949495459501737958331952853208805511'
    '12540698747158523863050715693290963295227443043557'
    '66896648950445244523161731856403098711121722383113'
    '62229893423380308135336276614282806444486645238749'
    '30358907296290491560440772390713810515859307960866'
    '70172427121883998797908792274921901699720888093776'
    '65727333001053367881220235421809751254540594752243'
    '52584907711670556013604839586446706324415722155397'
    '53697817977846174064955149290862569321978468622482'
    '83972241375657056057490261407972968652414535100474'
    '82166370484403199890008895243450658541227588666881'
    '16427171479924442928230863465674813919123162824586'
    '17866458359124566529476545682848912883142607690042'
    '24219022671055626321111109370544217506941658960408'
    '07198403850962455444362981230987879927244284909188'
    '84580156166097919133875499200524063689912560717606'
    '05886116467109405077541002256983155200055935729725'
    '71636269561882670428252483600823257530420752963450'
)






def 						a    (		lowerCamelCase_ = N       ):






				'''simple docstring'''
				return max(
				    # mypy cannot properly interpret reduce
				    int(reduce(lambda lowerCamelCase_	,     lowerCamelCase_       : str(int(lowerCamelCase_       ) * int(lowerCamelCase_       )       )	,     n[i : i + 13]       )       )
				    for i in range(len(lowerCamelCase_       ) - 12       )       )


if __name__ == "__main__":
							print(F"{solution() = }")




