

"""simple docstring"""




import os
import sys
import time

from . import transposition_cipher as trans_cipher







def       snake_case__    (       ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE										='Prehistoric Men.txt'
     SCREAMING_SNAKE_CASE										='Output.txt'
     SCREAMING_SNAKE_CASE										=int(input('Enter key: '      )      )
     SCREAMING_SNAKE_CASE										=input('Encrypt/Decrypt [e/d]: '      )

     if not os.path.exists(lowerCAmelCase_      ):
          print(F'File {input_file} does not exist. Quitting...'      )
          sys.exit()
     if os.path.exists(lowerCAmelCase_      ):
          print(F'Overwrite {output_file}? [y/n]'      )
          SCREAMING_SNAKE_CASE										=input('> '      )
          if not response.lower().startswith('y'      ):
               sys.exit()

     SCREAMING_SNAKE_CASE										=time.time()
     if mode.lower().startswith('e'      ):
          with open(lowerCAmelCase_      ) as f:
               SCREAMING_SNAKE_CASE										=f.read()
          SCREAMING_SNAKE_CASE										=trans_cipher.encrypt_message(lowerCAmelCase_,   lowerCAmelCase_      )
     elif mode.lower().startswith('d'      ):
          with open(lowerCAmelCase_      ) as f:
               SCREAMING_SNAKE_CASE										=f.read()
          SCREAMING_SNAKE_CASE										=trans_cipher.decrypt_message(lowerCAmelCase_,   lowerCAmelCase_      )

     with open(lowerCAmelCase_,   'w'      ) as output_obj:
          output_obj.write(lowerCAmelCase_      )

     SCREAMING_SNAKE_CASE										=round(time.time() - start_time,   2      )
     print(('Done (', total_time, 'seconds )')      )


if __name__ == "__main__":
 main()




def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE										=len(lowerCAmelCase_      )
     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)
                    SCREAMING_SNAKE_CASE										=lst[j + 1]
                    SCREAMING_SNAKE_CASE										=lst[j]
                    SCREAMING_SNAKE_CASE										=temp
               if (
                   lst[no_of_elements - 1 - j] < lst[no_of_elements - 2 - j]
               ):  # applying bubble sort algorithm from right to left (or backwards)
                    SCREAMING_SNAKE_CASE										=lst[no_of_elements - 1 - j]
                    SCREAMING_SNAKE_CASE										=lst[no_of_elements - 2 - j]
                    SCREAMING_SNAKE_CASE										=temp
     return lst


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

