function add_palindrome_substring(s, l, r, substrings):
while l >= 0 and r < s.length and s[l] == s[r]:
substrings.add(substring of s from position l to r)
l -= 1
r += 1
s = input()
n = s.length
substrings = set()
for i = 0 -> n:
if i + 1 < n:
add_palindrome_substring(s, i, i + 1, substrings)
if i + 2 < n:
add_palindrome_substring(s, i, i + 2, substrings)