while gets
  s = ''
  $_.split('').each{|c| s += c.capitalize if c =~ /[a-zA-Z]/ }
  ret = []
  (1..s.size-2).each do |c|
    l = r = c
    while l >= 0 && r < s.size
      break if s[l] != s[r]
      l -= 1; r += 1
    end
    ret << s[l+1..r-1] if r - l >= 3
  end
  puts ret.uniq.join(' ')
end