#include <bits/stdc++.h>
using namespace std;
void _print(vector<int> v1) {
  cerr << "[ ";
  for (auto i : v1) {
    cerr << i << " ";
  }
  cerr << "]";
}
void _printt(vector<vector<int>> v) {
  cerr << "\n";
  for (auto i : v) {
    cerr << "[ ";
    for (auto j : i) {
      cerr << j << " ";
    }
    cerr << "]\n";
  }
}
void _print(vector<vector<long long>> v) {
  cerr << "\n";
  for (auto i : v) {
    cerr << "[ ";
    for (auto j : i) {
      cerr << j << " ";
    }
    cerr << "]\n";
  }
}
void _print(vector<pair<int, int>> v) {
  cerr << "[ ";
  for (int i = 0; i < v.size(); i++) {
    cerr << "( " << v[i].first << " " << v[i].second << " )";
  }
  cerr << " ]";
}
void _print(int a) { cerr << a; }
void _print(long long a) { cerr << a; }
void _print(char a) { cerr << a; }
void _print(string a) { cerr << a; }
void _print(bool a) { cerr << a; }
void _print(map<int, int> m) {
  cerr << "\n";
  for (auto &i : m) {
    cerr << i.first << " " << i.second << "\n";
  }
}
void _print(unordered_map<int, int> m) {
  cerr << "\n";
  for (auto &i : m) {
    cerr << i.first << " " << i.second << "\n";
  }
}
void _print(deque<int> d) {
  cerr << "[ ";
  for (auto &i : d) {
    cerr << i << " ";
  }
  cerr << "]";
}
long long binpow(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a;
    a = a * a;
    b >>= 1;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  if (s.size() == 1) {
    cout << s[0] << "\n";
    return 0;
  }
  sort(s.begin(), s.end(), greater<int>());
  ;
  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] == s[i + 1]) {
      cout << s[i];
    } else {
      cout << s[i];
      break;
    }
    if (i == s.size() - 2) {
      if (s[s.size() - 1] == s[s.size() - 2]) {
        cout << s[s.size() - 1];
      }
    }
  }
  cout << "\n";
  return 0;
}
