from __future__ import annotations

from itertools import permutations
from random import randint
from timeit import repeat






def 				__lowerCamelCase		(						):
       lowerCAmelCase__					     = [randint(-1_0_0_0     ,  1_0_0_0     ) for i in range(1_0     )]
       lowerCAmelCase__					     = randint(-5_0_0_0     ,  5_0_0_0     )
       return (arr, r)


lowerCAmelCase__     						=			make_dataset()






def 				__lowerCamelCase		(						lowerCAmelCase__     ,  lowerCAmelCase__     ):
       for triplet in permutations(lowerCAmelCase__     ,  3     ):
              if sum(lowerCAmelCase__     ) == target:
                     return tuple(sorted(lowerCAmelCase__     )     )
       return (0, 0, 0)






def 				__lowerCamelCase		(						lowerCAmelCase__     ,  lowerCAmelCase__     ):
       arr.sort()
       lowerCAmelCase__					     = len(lowerCAmelCase__     )
       for i in range(n - 1     ):
              lowerCAmelCase__     , lowerCAmelCase__					     = i + 1, n - 1
              while left < right:
                     if arr[i] + arr[left] + arr[right] == target:
                            return (arr[i], arr[left], arr[right])
                     elif arr[i] + arr[left] + arr[right] < target:
                            left += 1
                     elif arr[i] + arr[left] + arr[right] > target:
                            right -= 1
       return (0, 0, 0)






def 				__lowerCamelCase		(						):
       lowerCAmelCase__					     = '\nfrom __main__ import dataset, triplet_sum1, triplet_sum2\n'
       lowerCAmelCase__					     = '\ntriplet_sum1(*dataset)\n'
       lowerCAmelCase__					     = '\ntriplet_sum2(*dataset)\n'
       lowerCAmelCase__					     = repeat(setup=lowerCAmelCase__     ,  stmt=lowerCAmelCase__     ,  repeat=5     ,  number=1_0_0_0_0     )
       lowerCAmelCase__					     = repeat(setup=lowerCAmelCase__     ,  stmt=lowerCAmelCase__     ,  repeat=5     ,  number=1_0_0_0_0     )
       return (min(lowerCAmelCase__     ), min(lowerCAmelCase__     ))


if __name__ == "__main__":
    from doctest import testmod

    testmod()
    lowerCAmelCase__     						=			solution_times()
    print(F'The time for naive implementation is {times[0]}.')
    print(F'The time for optimized implementation is {times[1]}.')

import copy
from dataclasses import dataclass
from pathlib import Path
from typing import Dict, Optional, Union
@dataclass
class     a_			:






 '''simple docstring'''






 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= True
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= 1
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= False
 UpperCAmelCase_     			= None
 UpperCAmelCase_     			= None




 def 		__snake_case						(      self :  Dict):







        '''simple docstring'''



        return self.__class__(**{k: copy.deepcopy(lowercase__) for k, v in self.__dict__.items()})
