#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  int n = (int)s.length();
  int k;
  char x;
  map<char, int> m;
  for (int i = 0; i < n; i++) {
    m[s[i]]++;
  }
  map<char, int>::reverse_iterator r = m.rbegin();
  x = r->first;
  k = r->second;
  for (int i = 0; i < k; i++) {
    cout << x;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(nullptr);
  solve();
}
