#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int N = 1e3 + 10;
int main() {
  string str;
  cin >> str;
  int cnt = 0;
  char ans = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] > ans)
      ans = str[i], cnt = 1;
    else if (ans == str[i])
      cnt++;
  }
  while (cnt--) cout << ans;
  return 0;
}
