def check(l, r, s, len)
  while l >= 0 && r < len
    break if s[l] != s[r]
    l -= 1; r += 1
  end
  s[l+1..r-1] if (r - 1) - (l + 1) >= 2
end

while l = gets
  s = ''
  l.split('').each{|c| s += c.capitalize if c =~ /[a-zA-Z]/ }
  cand = []
  len = s.size
  (1..len-2).each do |c|
    cand << check(c, c, s, len)
    cand << check(c, c + 1, s, len)
  end
  cand = cand.compact.uniq
  checker = cand.map{ |s| (1...(s.size-1)/2).map{ |i| s[i...-i] }}.flatten.uniq
  ret = []
  cand.each{ |s| ret << s unless checker.include?(s) }
  puts ret.join(' ')
end