#include#include #include <string> #include using namespace std;bool isReverse(string s) {string t = s;reverse(t.begin(), t.end()); if (s == t)return true;else return false; }int main() {string s;string target, ans;cin >> s;for (unsigned i = 0; i < s.length(); i++){for (int j = 0; j < i; j++){target = s.substr(j, i);if (isReverse(target) && target.length() > ans.length()){ans = target;}}}cout << ans << endl;return 0; }