#include <bits/stdc++.h>
using namespace std;
template <class A>
istream& operator>>(istream& in, vector<A>& a) {
  for (A& i : a) in >> i;
  return in;
}
template <class A>
ostream& operator<<(ostream& in, vector<A>& a) {
  for (A& i : a) in << i << ' ';
  in << "\n";
  return in;
}
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    y >>= 1;
    x = (x * x) % MOD;
  }
  return (res % MOD);
}
void solve() {
  string s;
  cin >> s;
  map<char, int> mp;
  for (int i = 0; i < s.size(); i++) {
    mp[s[i]]++;
  }
  auto itr = mp.end();
  --itr;
  for (int i = 0; i < itr->second; i++) {
    cout << itr->first;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc = 1;
  for (int t = 1; t <= tc; t++) {
    solve();
  }
}
