### main

while line = gets
  str = ''
  for ch in line.split('')
    if ("A".."Z").include?(ch) || ("a".."z").include?(ch)
      str += ch.upcase
    end
  end
  #p str

  slen = str.length
  pldrms = {}
  ngs = {}
  
  for i in (0...slen)
    d = 1
    while i - d >= 0 && i + d < slen && str[i - d] == str[i + d]
      d += 1
    end
    d -= 1
    if d > 0
      pldrm = str[i]
      for d0 in (1...d)
        pldrm = str[i - d0] + pldrm + str[i + d0]
        ngs[pldrm] = true
      end
      pldrm = str[i - d] + pldrm + str[i + d]
      pldrms[pldrm] = true
    end

    if i + 1 < slen && str[i] == str[i + 1]
      d = 1
      while i - d >= 0 && i + d < slen && str[i - d] == str[i + 1 + d]
        d += 1
      end
      d -= 1
      if d > 0
        pldrm = str[i, 2]
        for d0 in (1...d)
          pldrm = str[i - d0] + pldrm + str[i + 1 + d0]
          ngs[pldrm] = true
        end
        pldrm = str[i - d] + pldrm + str[i + 1 + d]
        pldrms[pldrm] = true
      end
    end
  end

  puts pldrms.keys.select{|pl| ! ngs[pl]}.join(' ')
end