#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  string s;
  cin >> s;
  vector<long long> a;
  vector<long long> b(130, 0);
  for (int i = 0; i < s.length(); ++i) {
    a.emplace_back(s[i]);
    ++b[s[i]];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < b[a.back()]; ++i) {
    cout << (char)a.back();
  }
}
