


def 			_a      (    __UpperCamelCase			):
     barcode //= 1_0  # exclude the last digit
     a_     :  str				      =     False
     a_     :  Union[str, Any]				      =     0

     # extract and check each digit
     while barcode != 0:
          a_     :  List[Any]				      =     1 if checker else 3
          s += mult * (barcode % 1_0)
          barcode //= 1_0
          a_     :  Dict				      =     not checker

     return (1_0 - (s % 1_0)) % 1_0



def 			_a      (    __UpperCamelCase			):
     return len(str(__UpperCamelCase			)			) == 1_3 and get_check_digit(__UpperCamelCase			) == barcode % 1_0



def 			_a      (    __UpperCamelCase			):
     if str(__UpperCamelCase			).isalpha():
          a_     :  Optional[int]				      =     F'''Barcode \'{barcode}\' has alphabetic characters.'''
          raise ValueError(__UpperCamelCase			)
     elif int(__UpperCamelCase			) < 0:
          raise ValueError("""The entered barcode has a negative value. Try again."""			)
     else:
          return int(__UpperCamelCase			)


if __name__ == "__main__":
       import doctest

       doctest.testmod()
       __lowerCamelCase   	=  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.''')







__lowerCamelCase   	=  {0: [1, 2], 1: [0, 3], 2: [0], 3: [1], 4: [5, 6], 5: [4, 6], 6: [4, 5]}

__lowerCamelCase   	=  {0: [1, 2, 3], 1: [0, 3], 2: [0], 3: [0, 1], 4: [], 5: []}



def 			_a      (    __UpperCamelCase	,	__UpperCamelCase	,	__UpperCamelCase			):
     a_     :  Tuple				      =     True
     a_     :  Optional[Any]				      =     []

     for neighbour in graph[vert]:
          if not visited[neighbour]:
               connected_verts += dfs(__UpperCamelCase	,	__UpperCamelCase	,	__UpperCamelCase			)

     return [vert, *connected_verts]



def 			_a      (    __UpperCamelCase			):
     a_     :  Dict				      =     len(__UpperCamelCase			)
     a_     :  List[str]				      =     graph_size * [False]
     a_     :  Dict				      =     []

     for i in range(__UpperCamelCase			):
          if not visited[i]:
               a_     :  str				      =     dfs(__UpperCamelCase	,	__UpperCamelCase	,	__UpperCamelCase			)
               components_list.append(__UpperCamelCase			)

     return components_list


if __name__ == "__main__":
       import doctest

       doctest.testmod()



