#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <cctype>
#include <vector>

using namespace std;

typedef long long lli;

string str;
int n;

int main(){
  string in;
  while(getline(cin ,in)){
    str = "";
    for(int i=0;i<in.size();i++){
      if(isalpha(in[i])){
        str += toupper(in[i]);
      }
    }
    n = str.size();
    set<string> s;
    for(int i=0;i<n-2;i++){
      lli h1 = 0, h2 = 0, b = 1;
      int j = i;
      for(int k=0;k<2;k++){
        h1 *= 29;
        h1 += str[j] - 'A';
        h2 += b * (str[j] - 'A');
        b *= 29;
        j++;
      }
      for(;j<n;j++){
        h1 *= 29;
        h1 += str[j] - 'A';
        h2 += b * (str[j] - 'A');
        b *= 29;
        if(h1 == h2) s.insert(str.substr(i, j-i+1));
      }
    }
    vector<string> v;
    for(set<string>::iterator it=s.begin();it!=s.end();it++) v.push_back(*it);
    int m = v.size();
    bool f = true;
    vector<int> len;
    for(int i=0;i<m;i++) len.push_back(v[i].size());
    for(int i=0;i<m;i++){
      bool f2 = true;
      for(int j=0;j<m;j++){
        if(i == j) continue;
        if(len[i] < len[j] && v[i] == v[j].substr((len[j] - len[i]) / 2, len[i])){
          f2 = false;
          break;
        }
      }
      if(f2){
        if(!f) cout << " ";
        else f = false;
        cout << v[i];
      }
    }
    cout << endl;
  }
}