#include <bits/stdc++.h>
const long long INF = 1e18;
const int32_t M = 1e9 + 7;
using namespace std;
int gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void solve() {
  string s;
  cin >> s;
  int m = 0, c = 0;
  for (int i = 0; i < s.length(); i++) {
    if (int(s[i]) > m) {
      m = int(s[i]);
    }
  }
  for (int i = 0; i < s.length(); i++) {
    if (int(s[i]) == m) {
      c++;
    }
  }
  char ch = (char)m;
  for (int i = 0; i < c; i++) cout << ch;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) solve();
  return 0;
}
