





import os






def 				_UpperCAmelCase			(    A = "matrix.txt"     ):




   '''simple docstring'''

   with open(os.path.join(os.path.dirname(A     )				,							A     )     ) as in_file:
      UpperCAmelCase__						=in_file.read()

   UpperCAmelCase__						=[[int(A     ) for cell in row.split(","     )] for row in data.strip().splitlines()]
   UpperCAmelCase__						=[[0 for cell in row] for row in grid]
   UpperCAmelCase__						=len(grid[0]     )

   UpperCAmelCase__						=[[0 for i in range(A     )] for j in range(A     )]
   UpperCAmelCase__						=grid[0][0]
   for i in range(1				,							A     ):
      UpperCAmelCase__						=grid[0][i] + dp[0][i - 1]
   for i in range(1				,							A     ):
      UpperCAmelCase__						=grid[i][0] + dp[i - 1][0]

   for i in range(1				,							A     ):
      for j in range(1				,							A     ):
         UpperCAmelCase__						=grid[i][j] + min(dp[i - 1][j]				,							dp[i][j - 1]     )

   return dp[-1][-1]


if __name__ == "__main__":
    print(f"""{solution() = }""")










def 				_UpperCAmelCase			(    A     ):




   '''simple docstring'''

   for i in range(len(A     ) - 1				,							0				,							-1     ):
      UpperCAmelCase__						=False

      for j in range(A				,							0				,							-1     ):
         if unsorted[j] < unsorted[j - 1]:
            UpperCAmelCase__			,							UpperCAmelCase__						=unsorted[j - 1], unsorted[j]
            UpperCAmelCase__						=True

      for j in range(A     ):
         if unsorted[j] > unsorted[j + 1]:
            UpperCAmelCase__			,							UpperCAmelCase__						=unsorted[j + 1], unsorted[j]
            UpperCAmelCase__						=True

      if not swapped:
         break
   return unsorted


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    UpperCamelCase_												=	input('Enter numbers separated by a comma:\n').strip()
    UpperCamelCase_												=	[int(item) for item in user_input.split(',')]
    print(f"""{cocktail_shaker_sort(unsorted) = }""")



