#include <bits/stdc++.h>
using namespace std;
string lps(string s) {
  string res;
  char mx = s[0];
  for (int i = 1; i < s.length(); i++) mx = max(mx, s[i]);
  for (int i = 0; i < s.length(); i++)
    if (s[i] == mx) res += s[i];
  return res;
}
void solve() {
  string s;
  cin >> s;
  cout << lps(s) << "\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
