#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[11], ans[11];
  cin >> s;
  int n = strlen(s);
  char c = 'A';
  for (int i = 0; i < n; i++) {
    c = max(c, s[i]);
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == c) cnt++;
  }
  for (int i = 0; i < cnt; i++) cout << c;
  cout << endl;
  return 0;
}
