'''simple docstring'''




def      _UpperCAmelCase    (							_UpperCamelCase    :	Optional[int]   )	->      str:
    barcode //= 10  # exclude the last digit
    A_     =   False
    A_     =   0

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

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





def      _UpperCAmelCase    (							_UpperCamelCase    :	Tuple   )	->      Dict:
    return len(str(_lowerCamelCase   )   ) == 13 and get_check_digit(_lowerCamelCase   ) == barcode % 10





def      _UpperCAmelCase    (							_UpperCamelCase    :	Dict   )	->      List[str]:
    if str(_lowerCamelCase   ).isalpha():
        A_     =   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()
  __snake_case   :      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.""")














"""simple docstring"""
def        lowerCamelCase_  (						_lowerCamelCase				):
 lowerCamelCase__     :			int     				=						5381
 for x in s:
  lowerCamelCase__     :			Union[str, Any]     				=						((hash_value << 5) + hash_value) + ord(_lowerCamelCase				)
 return hash_value & 0Xffffffff

