#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  string str;
  cin >> str;
  map<char, int> m;
  for (int i = 0; i < str.size(); i += 1) m[str[i]]++;
  for (auto it = m.rbegin(); it != m.rend(); it++) {
    int temp = it->second;
    if (temp != 0) {
      while (temp--) cout << it->first;
      cout << endl;
      break;
    }
  }
  return 0;
}
