#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int L = s.length();
  int Max = int(s[0]);
  for (int i = 1; i < L; i += 1) {
    int m = int(s[i]);
    if (Max < m) {
      Max = m;
    }
  }
  int count = 0;
  char ch = char(Max);
  for (int i = 0; i < L; i += 1) {
    if (ch == s[i]) count += 1;
  }
  for (int i = 0; i < count; i += 1) cout << ch;
}
