






"""simple docstring"""





from __future__ import annotations






def 							A(    snake_case_		,  snake_case_		,  snake_case_		,  snake_case_						):
       """simple docstring"""





       lowercase__    ,      lowercase__:							Tuple         =     m - 1, 0
       while i >= 0 and j < n:
              if key == mat[i][j]:
                     print(F"""Key {key} found at row- {i + 1} column- {j + 1}"""						)
                     return
              if key < mat[i][j]:
                     i -= 1
              else:
                     j += 1
       print(F"""Key {key} not found"""						)






def 							A(    ):
       """simple docstring"""





       lowercase__:							Optional[Any]         =     [[2, 5, 7], [4, 8, 13], [9, 11, 15], [12, 17, 20]]
       lowercase__:							Tuple         =     int(input("Enter the element to be searched:"						)						)
       print(snake_case_						)
       search_in_a_sorted_matrix(snake_case_		,  len(snake_case_						)		,  len(mat[0]						)		,  snake_case_						)


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()








def  A			(   lowercase					)  ->    int:
		'''simple docstring'''

		barcode //= 10  # exclude the last digit
		UpperCamelCase            =	False
		UpperCamelCase            =	0

		# extract and check each digit
		while barcode != 0:
				UpperCamelCase            =	1 if checker else 3
				s += mult * (barcode % 10)
				barcode //= 10
				UpperCamelCase            =	not checker

		return (10 - (s % 10)) % 10


def  A			(   lowercase					)  ->    bool:
		'''simple docstring'''

		return len(str(lowercase					)					) == 13 and get_check_digit(lowercase					) == barcode % 10


def  A			(   lowercase					)  ->    int:
		'''simple docstring'''

		if str(lowercase					).isalpha():
				UpperCamelCase            =	f'''Barcode \'{barcode}\' has alphabetic characters.'''
				raise ValueError(lowercase					)
		elif int(lowercase					) < 0:
				raise ValueError('The entered barcode has a negative value. Try again.'					)
		else:
				return int(lowercase					)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					_UpperCAmelCase   :					List[str]    =			get_barcode(input("Barcode: ").strip())

					if is_valid(barcode):
										print(F'''\'{barcode}\' is a valid barcode.''')
					else:
										print(F'''\'{barcode}\' is NOT a valid barcode.''')
