#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.length();
  vector<pair<int, char> > v;
  int k;
  for (int i = 0; i < n; i++) {
    v.push_back(make_pair(int(s[i]), s[i]));
  }
  sort(v.begin(), v.end());
  char c = v[v.size() - 1].second;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == c) cnt++;
  }
  for (int i = 0; i < cnt; i++) {
    cout << c;
  }
  cout << endl;
  return 0;
}
