def next_smallest_palindrome(num):
    candidate = num + 1
    while True:
        s = str(candidate)
        if s == s[::-1]:
            return candidate
        candidate += 1