#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int freq[26];
int main() {
  string s;
  cin >> s;
  int mx = -1;
  char g = s[0];
  for (int i = 0; i < s.size(); i++) {
    freq[s[i] - 'a']++;
    if (s[i] >= g) {
      mx = max(mx, freq[s[i] - 'a']);
      g = s[i];
    }
  }
  string d(freq[g - 'a'], g);
  cout << d << endl;
  return 0;
}
