#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

int main(){
  string buff;
  int ccc = 0;
  while(getline(cin,buff)){
    char strt[2048];
    int len = 0;

    for(int i=0; i<buff.size(); i++)
      if(isalpha(buff[i]))
        strt[len++] = toupper(buff[i]);
    strt[len++] = '\0';

    string str(strt);
    set<string> ans;
    set<string> bad;

    for(int l = str.size(); l >= 3; l--){
      for(int i = 0; i+l-1 < str.size(); i++){
        int ll = i;
        int rr = i + l - 1;
        bool f = true;
        //cout << "test: " << str.substr(i, l) << endl;
        while(ll < rr){
          if(str[ll] == str[rr]){
            ll++; rr--;
          }else{
            f = false;
            break;
          }
        }

        if(f){
          string nstr = str.substr(i, l);
          if(bad.find(nstr) == bad.end()){
            // bad.insert(nstr);
            ans.insert(nstr);
            for(int ii=1; ii<(int)nstr.size(); ii++){
              int jj = nstr.size() - 1 - ii;
              int ln = jj - ii + 1;
              if(ln > 1)
                bad.insert(nstr.substr(ii,ln));
            }
          }
        }
      }
    }

    int cc = 0;
    FOR(it,ans){
      if(bad.count(*it) == 0){
        if(cc++ != 0) printf(" ");
        printf("%s",it->c_str());
      }
      bad.insert(*it);
    }

    puts("");
  }
  return 0;
}