#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  char aa = 'a';
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] > aa) aa = s[i];
  }
  long long c = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == aa) c++;
  }
  for (long long i = 0; i < c; i++) cout << aa;
  cout << endl;
  return 0;
}
