#include <bits/stdc++.h>
using namespace std;
const int MAX = 10;
char cadena[MAX];
int main() {
  cin >> cadena;
  sort(cadena, cadena + 10);
  cout << cadena[9];
  for (int i = 8; i >= 0; i--) {
    if (i == 0) {
      int c = 0;
    }
    if (cadena[i] == cadena[i + 1])
      cout << cadena[i];
    else
      break;
  }
  cout << endl;
  return 0;
}
