#include <bits/stdc++.h>
using namespace std;
set<int> st[3];
int ar[1000005];
int main() {
  int t, tc = 0;
  memset(ar, -1, sizeof ar);
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    st[s[i] - 'a'].insert(i);
  }
  string ans;
  int p = 0, q = 1000005 - 5, cnt = 0;
  while (cnt < s.size() / 2) {
    int x = 0, id;
    for (int i = 0; i < 3; i++) {
      if (st[i].size() == 0) continue;
      auto a = st[i].begin(), b = st[i].end();
      --b;
      if (*b - *a >= x) {
        id = i;
        x = *b - *a;
      }
    }
    auto a = st[id].begin(), b = st[id].end();
    --b;
    vector<int> v[3];
    for (int i = 0; i < 3; i++) {
      if (i == id) continue;
      for (auto it = st[i].rbegin(); it != st[i].rend(); it++) {
        if (*it > *b)
          v[i].push_back(*it);
        else
          break;
      }
      for (auto it = st[i].begin(); it != st[i].end(); it++) {
        if (*it < *a)
          v[i].push_back(*it);
        else
          break;
      }
    }
    for (int i = 0; i < 3; i++) {
      if (i == id) continue;
      for (auto j : v[i]) st[i].erase(j);
    }
    if (x != 0) {
      ar[p++] = id;
      ar[q--] = id;
      st[id].erase(a);
      st[id].erase(b);
      cnt += 2;
    } else {
      cnt++;
      ar[p++] = id;
      st[id].erase(a);
    }
  }
  for (int i = 0; i < 1000005; i++) {
    if (ar[i] != -1) ans.push_back(ar[i] + 'a');
  }
  cout << ans << endl;
  return 0;
}
