#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[11];
  while (cin >> a) {
    int len = strlen(a);
    char ch = 'a';
    for (int i = 0; i < len; i++)
      if (a[i] > ch) ch = a[i];
    for (int i = 0; i < len; i++)
      if (a[i] == ch) cout << ch;
    cout << endl;
  }
  return 0;
}
