#include <bits/stdc++.h>
using namespace std;
void solve() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (long long int i = 0; i < s.length(); i++) {
    mp[s[i]]++;
  }
  auto itr = mp.end();
  itr--;
  char c = itr->first;
  int n = itr->second;
  for (long long int i = 0; i < n; i++) cout << c;
  cout << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n = 1;
  while (n--) solve();
  return 0;
}
