#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

typedef tree<pair<int,int>, null_type, std::less<pair<int,int>>, rb_tree_tag, 
             tree_order_statistics_node_update> ordered_set;
#define ll long long 
#define ld long double
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

const ll INF = 1e9;
const ll mod = 1e9 + 7;
vector<string>res;
void rec(int idx , string s , string cur){
    if(idx == s.size()){
        string tmp  = cur;
        reverse(all(tmp));
        if(tmp == cur){
            res.push_back(cur);
        }
        return ;
    }
    string tmp = cur;
    reverse(all(tmp));
    if(cur == tmp){
        res.push_back(cur);
    }
    rec(idx+1,s,cur+s[idx]);
    rec(idx+1,s,"");
}
void Bavly() {
    string s ;
    cin >> s;
    rec(0,s,"");
    sort(all(res));
    for(auto i : res){
        if(i.size())cout << i << "\n";
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ll t =1;
    //cin >> t;
    while(t--){
        Bavly();      
    }
}