#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s, ans;
  cin >> s;
  char ch = 'a';
  for (long long i = 0; i < s.size(); i++) {
    ch = max(ch, s[i]);
  }
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == ch) ans += ch;
  }
  cout << ans << "\n";
  ;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
