#include <bits/stdc++.h>
using namespace std;
int main() {
  string g;
  cin >> g;
  sort(g.begin(), g.end());
  int i = g.length() - 1;
  cout << g[i];
  char p = g[i--];
  while (i > -1)
    if (g[i--] == p) cout << p;
  return 0;
}
