def longest_palindrome(s: str) -> str:
    if len(s) == 0:
        return ""

    start, end = 0, 0

    for i in range(len(s)):
        len1 = expand_around_center(s, i, i)
        len2 = expand_around_center(s, i, i + 1)
        max_len = max(len1, len2)

        if max_len > end - start:
            start = i - (max_len - 1) // 2
            end = i + max_len // 2

    return s[start:end + 1]

def expand_around_center(s, left, right):
    while left >= 0 and right < len(s) and s[left] == s[right]:
        left -= 1
        right += 1
    return right - left - 1

def is_valid_string(s: str) -> bool:
    return all(c.isalnum() for c in s)

# Getting input from the user
input_string = input("Enter a text string to check the longest symmetric string (it should contain only numbers and English letters):")

# Validating the entered string
if not is_valid_string(input_string):
    print("The string contains invalid letters or symbols. Please enter a string containing only English numbers and letters.")
else:
    # Call the function and view the result
    output_string = longest_palindrome(input_string)
    print(f"The longest symmetric series in the input series is: {output_string}")
