

_UpperCAmelCase    	=			10**8


def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  bool:
      if n % 10 == 0:
            return False
      A    =				str(lowerCAmelCase     )
      return s == s[::-1]


def 			__UpperCamelCase    ()     ->  int:
      A    =				set()
      A    =				1
      A    =				5
      while sum_squares < LIMIT:
            A    =				first_square + 1
            while sum_squares < LIMIT:
                  if is_palindrome(lowerCAmelCase     ):
                        answer.add(lowerCAmelCase     )
                  last_square += 1
                  sum_squares += last_square**2
            first_square += 1
            A    =				first_square**2 + (first_square + 1) ** 2

      return sum(lowerCAmelCase     )


if __name__ == "__main__":
  print(solution())






def 			__UpperCamelCase    (lowerCAmelCase					:  int     )     ->  int:
      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    (lowerCAmelCase					:  int     )     ->  bool:
      return len(str(lowerCAmelCase     )     ) == 13 and get_check_digit(lowerCAmelCase     ) == barcode % 10


def 			__UpperCamelCase    (lowerCAmelCase					:  str     )     ->  int:
      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()
  _UpperCAmelCase    	=			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.''')



