


import operator







def        SCREAMING_SNAKE_CASE_						(			__A :			list  ,    __A :			bool = False  ,    __A :			list | None = None				)	->		list:

       """simple docstring"""

       a_					:		Union[str, Any]							=  operator.lt if reverse else operator.gt
       a_					:		List[str]							=  solution or []

       if not arr:
              return solution

       a_					:		str							=  [arr.pop(0				)]
       for i, item in enumerate(__A				):
              if _operator(__A  ,    sublist[-1]				):
                     sublist.append(__A				)
                     arr.pop(__A				)

    #  merging sublist into solution list
       if not solution:
              solution.extend(__A				)
       else:
              while sublist:
                     a_					:		List[Any]							=  sublist.pop(0				)
                     for i, xx in enumerate(__A				):
                            if not _operator(__A  ,    __A				):
                                   solution.insert(__A  ,    __A				)
                                   break
                     else:
                            solution.append(__A				)

       strand_sort(__A  ,    __A  ,    __A				)
       return solution


if __name__ == "__main__":
   assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
   assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]






UpperCAmelCase_      : Optional[int]  					=       [4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
UpperCAmelCase_      : str  					=       [3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
UpperCAmelCase_      : str  					=       {
    0: 'Sunday',
    1: 'Monday',
    2: 'Tuesday',
    3: 'Wednesday',
    4: 'Thursday',
    5: 'Friday',
    6: 'Saturday',
}







def        SCREAMING_SNAKE_CASE_						(			__A :			int  ,    __A :			int  ,    __A :			int				)	->		str:

       """simple docstring"""

       assert len(str(__A				)				) > 2, "year should be in YYYY format"
       assert 1 <= month <= 12, "month should be between 1 to 12"
       assert 1 <= day <= 31, "day should be between 1 to 31"

       # Doomsday algorithm:
       a_					:		List[str]							=  year // 1_00
       a_					:		Optional[int]							=  (5 * (century % 4) + 2) % 7
       a_					:		List[str]							=  year % 1_00
       a_					:		str							=  centurian % 12
       a_					:		List[str]							=  (
           (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
       ) % 7
       a_					:		Any							=  (
           DOOMSDAY_NOT_LEAP[month - 1]
           if (year % 4 != 0) or (centurian == 0 and (year % 4_00) == 0)
           else DOOMSDAY_LEAP[month - 1]
       )
       a_					:		Any							=  (dooms_day + day - day_anchor) % 7
       return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
   import doctest

   doctest.testmod()


