#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, d = "";
  getline(cin, s);
  s = " " + s;
  int i, l = 0, j;
  for (i = int('z'); i >= int('a'); i--) {
    for (j = 1; j < s.length(); j++)
      if (s[j] == char(i)) l++;
    if (l > 0) {
      for (j = 1; j <= l; j++) d += char(i);
      break;
    }
  }
  cout << d;
  return 0;
}
