#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  long long a[31];
  for (long long i = 1; i <= 26; i++) a[i] = 0;
  for (long long i = 0; i < s.size(); i++) {
    a[int(s[i]) - 96]++;
  }
  for (long long i = 26; i >= 1; i--) {
    if (a[i] > 0) {
      for (long long j = 0; j < a[i]; j++) cout << char(96 + i);
      break;
    }
  }
  return 0;
}
