




'''simple docstring'''

from __future__ import annotations



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__      ):


						'''simple docstring'''






						if (direction == 1 and array[indexa] > array[indexa]) or (
						    direction == 0 and array[indexa] < array[indexa]
						):
												_lowerCAmelCase						,				_lowerCAmelCase										=array[indexa], array[indexa]



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__      ):


						'''simple docstring'''






						if length > 1:
												_lowerCAmelCase										=int(length / 2      )
												for i in range(_snake_case			,      low + middle      ):
																		comp_and_swap(_snake_case			,      _snake_case			,      i + middle			,      _snake_case      )
												bitonic_merge(_snake_case			,      _snake_case			,      _snake_case			,      _snake_case      )
												bitonic_merge(_snake_case			,      low + middle			,      _snake_case			,      _snake_case      )



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__      ):


						'''simple docstring'''






						if length > 1:
												_lowerCAmelCase										=int(length / 2      )
												bitonic_sort(_snake_case			,      _snake_case			,      _snake_case			,      1      )
												bitonic_sort(_snake_case			,      low + middle			,      _snake_case			,      0      )
												bitonic_merge(_snake_case			,      _snake_case			,      _snake_case			,      _snake_case      )


if __name__ == "__main__":
							lowercase_     		= input('''Enter numbers separated by a comma:\n''').strip()
							lowercase_     		= [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=''', ''')






'''simple docstring'''

def 							UpperCamelCase__			(			a__ = 1_0_0_0      ):


						'''simple docstring'''






						_lowerCAmelCase										=2**power
						_lowerCAmelCase										=0
						while n:
												_lowerCAmelCase						,				_lowerCAmelCase										=r + n % 1_0, n // 1_0
						return r


if __name__ == "__main__":
							print(solution(int(str(input()).strip())))





