


from typing import Dict, Optional, Tuple

import torch






def  _UpperCAmelCase						( __lowerCamelCase							)		->torch.Tensor:


 '''simple docstring'''
 snake_case :			int							=   boundaries[1] - boundaries[0]
 snake_case :			Union[str, Any]							=   boundaries + step / 2
 snake_case :			Optional[Any]							=   torch.cat([bin_centers, (bin_centers[-1] + step).unsqueeze(-1							)]			,  dim=0							)
 return bin_centers






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase			,  )		->Tuple[torch.Tensor, torch.Tensor]:


 '''simple docstring'''
 snake_case :			int							=   _calculate_bin_centers(_UpperCAmelCase							)
 return (
     torch.sum(aligned_distance_error_probs * bin_centers			,  dim=-1							),
     bin_centers[-1],
 )






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase = 31			,  __lowerCamelCase = 64			,  **__lowerCamelCase			,  )		->Dict[str, torch.Tensor]:


 '''simple docstring'''
 snake_case :			Union[str, Any]							=   torch.linspace(0			,  _UpperCAmelCase			,  steps=(no_bins - 1)			,  device=logits.device							)

 snake_case :			List[str]							=   torch.nn.functional.softmax(_UpperCAmelCase			,  dim=-1							)
 snake_case	,       snake_case :			Optional[int]							=   _calculate_expected_aligned_error(
     alignment_confidence_breaks=_UpperCAmelCase			,  aligned_distance_error_probs=_UpperCAmelCase			,  )

 return {
     "aligned_confidence_probs": aligned_confidence_probs,
     "predicted_aligned_error": predicted_aligned_error,
     "max_predicted_aligned_error": max_predicted_aligned_error,
 }






def  _UpperCAmelCase						( __lowerCamelCase			,  __lowerCamelCase = None			,  __lowerCamelCase = 31			,  __lowerCamelCase = 64			,  __lowerCamelCase = 1E-8			,  **__lowerCamelCase			,  )		->torch.Tensor:


 '''simple docstring'''
 if residue_weights is None:
  snake_case :			Any							=   logits.new_ones(logits.shape[-2]							)

 snake_case :			Optional[Any]							=   torch.linspace(0			,  _UpperCAmelCase			,  steps=(no_bins - 1)			,  device=logits.device							)

 snake_case :			Union[str, Any]							=   _calculate_bin_centers(_UpperCAmelCase							)
 torch.sum(_UpperCAmelCase							)
 snake_case :			int							=   logits.shape[-2]
 snake_case :			Tuple							=   max(_UpperCAmelCase			,  19							)

 snake_case :			Optional[Any]							=   1.24 * (clipped_n - 15) ** (1.0 / 3) - 1.8

 snake_case :			Optional[Any]							=   torch.nn.functional.softmax(_UpperCAmelCase			,  dim=-1							)

 snake_case :			Optional[Any]							=   1.0 / (1 + (bin_centers**2) / (da**2))
 snake_case :			Tuple							=   torch.sum(probs * tm_per_bin			,  dim=-1							)

 snake_case :			Union[str, Any]							=   residue_weights / (eps + residue_weights.sum())
 snake_case :			List[Any]							=   torch.sum(predicted_tm_term * normed_residue_mask			,  dim=-1							)

 snake_case :			Any							=   per_alignment * residue_weights

 snake_case :			Dict							=   (weighted == torch.max(_UpperCAmelCase							)).nonzero()[0]
 return per_alignment[tuple(_UpperCAmelCase							)]











def 				A      (	_UpperCAmelCase							:  List[Any]       )							->					List[Any]:







			'''simple docstring'''
			_UpperCAmelCase									=  len(_UpperCAmelCase       )
			for _ in range(
			    0				,  int(((no_of_elements - 1) / 2) + 1       )       ):  # we don't need to traverse to end of list as
						for j in range(0				,  no_of_elements - 1       ):
									if (
									    lst[j + 1] < lst[j]
									):  # applying bubble sort algorithm from left to right (or forwards)
												_UpperCAmelCase									=  lst[j + 1]
												_UpperCAmelCase									=  lst[j]
												_UpperCAmelCase									=  temp
									if (
									    lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
									):  # applying bubble sort algorithm from right to left (or backwards)
												_UpperCAmelCase									=  lst[no_of_elements - 1 - j]
												_UpperCAmelCase									=  lst[no_of_elements - 2 - j]
												_UpperCAmelCase									=  temp
			return lst


if __name__ == "__main__":
							print("enter the list to be sorted")
							UpperCAmelCase__  =			[int(x) for x in input().split()]  # inputing elements of the list in one line
							UpperCAmelCase__  =			double_sort(lst)
							print("the sorted list is")
							print(sorted_lst)
