#include <bits/stdc++.h>
using namespace std;
void the_martian() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long int N = 1000005;
long long int vis[N];
int32_t main() {
  the_martian();
  {
    long long int i, j, k, n, m, ans = 0, cnt = 0, sum = 0;
    string s;
    cin >> s;
    n = s.size();
    if (n == 3 || n == 3) {
      cout << s[0];
    } else {
      i = 0;
      j = n - 1;
      while (i < n && j >= 0) {
        if (i > j) break;
        if (s[i] == s[j]) {
          vis[i] = 1;
          vis[j] = 1;
          j--;
          i++;
        } else {
          if (s[j - 1] == s[i] || s[j - 2] == s[i]) {
            j--;
          } else {
            i++;
          }
        }
      }
    }
    for (i = 0; i < n; i++) {
      if (vis[i]) {
        cout << s[i];
      }
    }
  }
}
