


'''simple docstring'''




def 	a_					( lowerCamelCase	:     str	, lowerCamelCase	:     str				):
   lowerCAmelCase     =			len(lowerCamelCase				)
   lowerCAmelCase     =			[]
   for i in range(len(lowerCamelCase				) - pat_len + 1				):
      lowerCAmelCase     =			True
      for j in range(lowerCamelCase				):
         if s[i + j] != pattern[j]:
            lowerCAmelCase     =			False
            break
      if match_found:
         position.append(lowerCamelCase				)
   return position


if __name__ == "__main__":
       assert naive_pattern_search("""ABCDEFG""", """DE""") == [3]
       print(naive_pattern_search("""ABAAABCDBBABCDDEBCABC""", """ABC"""))









'''simple docstring'''




from __future__ import annotations

from bisect import bisect_left
from functools import total_ordering
from heapq import merge

@total_ordering
class 		UpperCAmelCase_      (  __lowercase		):





     def __lt__( self       :      Optional[int]    ,      UpperCAmelCase__       :      List[str]    )				->  List[Any]:
        return self[-1] < other[-1]





     def __eq__( self       :      str    ,      UpperCAmelCase__       :      List[str]    )				->  Tuple:
        return self[-1] == other[-1]





def 	a_					( lowerCamelCase	:     list				):
   lowerCAmelCase     =			[]
   # sort into stacks
   for element in collection:
      lowerCAmelCase     =			Stack([element]				)
      lowerCAmelCase     =			bisect_left(lowerCamelCase	, lowerCamelCase				)
      if i != len(lowerCamelCase				):
         stacks[i].append(lowerCamelCase				)
      else:
         stacks.append(lowerCamelCase				)

    # use a heap-based merge to merge stack efficiently
   lowerCAmelCase     =			merge(*(reversed(lowerCamelCase				) for stack in stacks)				)
   return collection


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





