


'''simple docstring'''
from __future__ import annotations




def      __snake_case       (       lowerCamelCase_ :				list[list[int]]	,  lowerCamelCase_ :				list[list[int]]						):
				'''simple docstring'''




				assert len(lowerCamelCase_						) == len(lowerCamelCase_						)

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

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

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







'''simple docstring'''
def      __snake_case       (       lowerCamelCase_ :				int						):
				'''simple docstring'''




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

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

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




def      __snake_case       (       lowerCamelCase_ :				int						):
				'''simple docstring'''




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




def      __snake_case       (       lowerCamelCase_ :				str						):
				'''simple docstring'''




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


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						__magic_name__   :   Optional[int]  							=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.''')



