


'''simple docstring'''

def 							SCREAMING_SNAKE_CASE__(		_UpperCamelCase   :					list     ,		_UpperCamelCase   :					int )		->       int:





   '''simple docstring'''







   for index, item in enumerate(_UpperCamelCase ):
      if item == target:
         return index
   return -1



def 							SCREAMING_SNAKE_CASE__(		_UpperCamelCase   :					list     ,		_UpperCamelCase   :					int     ,		_UpperCamelCase   :					int     ,		_UpperCamelCase   :					int )		->       int:





   '''simple docstring'''







   if not (0 <= high < len(_UpperCamelCase ) and 0 <= low < len(_UpperCamelCase )):
      raise Exception("Invalid upper or lower bound!" )
   if high < low:
      return -1
   if sequence[low] == target:
      return low
   if sequence[high] == target:
      return high
   return rec_linear_search(_UpperCamelCase     ,		low + 1     ,		high - 1     ,		_UpperCamelCase )


if __name__ == "__main__":
       __lowercase:		List[str]    						=  input("Enter numbers separated by comma:\n").strip()
       __lowercase:		Any    						=  [int(item.strip()) for item in user_input.split(",")]

       __lowercase:		List[str]    						=  int(input("Enter a single number to be found in the list:\n").strip())
       __lowercase:		List[str]    						=  linear_search(sequence, target)
       if result != -1:
              print(F"""linear_search({sequence}, {target}) = {result}""")
       else:
              print(F"""{target} was not found in {sequence}""")



'''simple docstring'''

from __future__ import annotations



def 							SCREAMING_SNAKE_CASE__(		_UpperCamelCase   :					list[list[int]]     ,		_UpperCamelCase   :					list[list[int]] )		->       list[int]:





   '''simple docstring'''







   assert len(_UpperCamelCase ) == len(_UpperCamelCase )

   UpperCamelCase__			    =    len(_UpperCamelCase )
   UpperCamelCase__			    =    list(range(_UpperCamelCase ) )
   UpperCamelCase__			    =    [-1] * n  # who the donor has donated to
   UpperCamelCase__			    =    [-1] * n  # who the recipient has received from
   UpperCamelCase__			    =    [0] * n

   while unmatched_donors:
      UpperCamelCase__			    =    unmatched_donors[0]
      UpperCamelCase__			    =    donor_pref[donor]
      UpperCamelCase__			    =    donor_preference[num_donations[donor]]
      num_donations[donor] += 1
      UpperCamelCase__			    =    recipient_pref[recipient]
      UpperCamelCase__			    =    rec_record[recipient]

      if prev_donor != -1:
         if rec_preference.index(_UpperCamelCase ) > rec_preference.index(_UpperCamelCase ):
            UpperCamelCase__			    =    donor
            UpperCamelCase__			    =    recipient
            unmatched_donors.append(_UpperCamelCase )
            unmatched_donors.remove(_UpperCamelCase )
      else:
         UpperCamelCase__			    =    donor
         UpperCamelCase__			    =    recipient
         unmatched_donors.remove(_UpperCamelCase )
   return donor_record