#include <bits/stdc++.h>
using namespace std;
int t, n, m, i, j, ans, k, a, b, c, d, e, f, sz, q, x;
string s, s2, s3, s4, s5, s6;
int ar[(int)(1e6 + 10)], ar2[(int)(1e6 + 10)];
deque<int> v, v2;
void brainfuck();
int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  brainfuck();
  return 0;
}
void brainfuck() {
  cin >> s;
  sort(s.begin(), s.end());
  n = s.size();
  s2 = s[n - 1];
  s.erase(s.begin() + n - 1);
  while (s.size() && s[s.size() - 1] == s2[0]) {
    s2 += s[s.size() - 1];
    s.erase(s.begin() + s.size() - 1);
  }
  cout << s2;
}
