'''simple docstring'''






SCREAMING_SNAKE_CASE_	   =			{}






def  UpperCamelCase__					(					_lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	int:

  # if we are absent twice, or late 3 consecutive days,
  # no further prize strings are possible
  if late == 3 or absent == 2:
    return 0

  # if we have no days left, and have not failed any other rules,
  # we have a prize string
  if days == 0:
    return 1

  # No easy solution, so now we need to do the recursive calculation

  # First, check if the combination is already in the cache, and
  # if yes, return the stored value from there since we already
  # know the number of possible prize strings from this point on
  __UpperCAmelCase:					int		= (days, absent, late)
  if key in cache:
    return cache[key]

  # now we calculate the three possible ways that can unfold from
  # this point on, depending on our attendance today

  # 1) if we are late (but not absent), the "absent" counter stays as
  # it is, but the "late" counter increases by one
  __UpperCAmelCase:					List[Any]		= _calculate(days - 1   ,    _lowercase   ,    late + 1     )

  # 2) if we are absent, the "absent" counter increases by 1, and the
  # "late" counter resets to 0
  __UpperCAmelCase:					Any		= _calculate(days - 1   ,    absent + 1   ,    0     )

  # 3) if we are on time, this resets the "late" counter and keeps the
  # absent counter
  __UpperCAmelCase:					Dict		= _calculate(days - 1   ,    _lowercase   ,    0     )

  __UpperCAmelCase:					List[Any]		= state_late + state_absent + state_ontime

  __UpperCAmelCase:					Tuple		= prizestrings
  return prizestrings






def  UpperCamelCase__					(					_lowercase    :				int = 3_0     )							->	int:
  return _calculate(_lowercase   ,    absent=0   ,    late=0     )


if __name__ == "__main__":
    print(solution())
'''simple docstring'''






from __future__ import annotations






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if (direction == 1 and array[indexa] > array[indexa]) or (
      direction == 0 and array[indexa] < array[indexa]
  ):
    __UpperCAmelCase, __UpperCAmelCase:					str		= array[indexa], array[indexa]






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					List[str]		= int(length / 2     )
    for i in range(_lowercase   ,    low + middle     ):
      comp_and_swap(_lowercase   ,    _lowercase   ,    i + middle   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )
    bitonic_merge(_lowercase   ,    low + middle   ,    _lowercase   ,    _lowercase     )






def  UpperCamelCase__					(					_lowercase    :				list[int]   ,    _lowercase    :				int   ,    _lowercase    :				int   ,    _lowercase    :				int     )							->	None:
  if length > 1:
    __UpperCAmelCase:					Any		= int(length / 2     )
    bitonic_sort(_lowercase   ,    _lowercase   ,    _lowercase   ,    1     )
    bitonic_sort(_lowercase   ,    low + middle   ,    _lowercase   ,    0     )
    bitonic_merge(_lowercase   ,    _lowercase   ,    _lowercase   ,    _lowercase     )


if __name__ == "__main__":
    SCREAMING_SNAKE_CASE_	   =			input('Enter numbers separated by a comma:\n').strip()
    SCREAMING_SNAKE_CASE_	   =			[int(item.strip()) for item in user_input.split(',')]

    bitonic_sort(unsorted, 0, len(unsorted), 1)
    print('\nSorted array in ascending order is: ', end='')
    print(*unsorted, sep=', ')

    bitonic_merge(unsorted, 0, len(unsorted), 0)
    print('Sorted array in descending order is: ', end='')
    print(*unsorted, sep=', ')