#include <bits/stdc++.h>
using namespace std;
long long int find_mod(string s) {
  long long int i, x = 0;
  for (i = 0; i < s.length(); i++) x = (x * 10 + s[i] - '0') % 998244353;
  return x;
}
long long int prime[7000005 + 1];
void sieve1() {
  for (int i = 0; i <= 7000005; i++) prime[i] = 1;
  prime[0] = prime[1] = 0;
  for (long long int i = 4; i <= 7000005; i += 2) prime[i] = 0;
  for (int p = 3; p * p <= 7000005; p += 2) {
    if (prime[p] == 1)
      for (int i = p * 2; i <= 7000005; i += p) {
        prime[i] = 0;
      }
  }
}
int min_prime_div_of_n[7000005 + 1];
void sieve2() {
  memset(min_prime_div_of_n, 0, sizeof(min_prime_div_of_n));
  min_prime_div_of_n[0] = min_prime_div_of_n[1] = 1;
  for (int i = 2; i * i <= 7000005; i++) {
    if (min_prime_div_of_n[i] == 0) {
      for (int j = i * 2; j < 7000005; j += i) {
        if (min_prime_div_of_n[j] == 0) {
          min_prime_div_of_n[j] = i;
        }
      }
    }
  }
  for (int i = 2; i <= 7000005; i++)
    if (min_prime_div_of_n[i] == 0) min_prime_div_of_n[i] = i;
}
int max_prime_div_of_n[7000005 + 1];
void sieve3() {
  sieve1();
  memset(max_prime_div_of_n, 0, sizeof(max_prime_div_of_n));
  max_prime_div_of_n[0] = max_prime_div_of_n[1] = 1;
  for (int i = 2; i * i <= 7000005; i++) {
    if (max_prime_div_of_n[i] == 0) {
      for (int j = i * 2; j < 7000005; j += i) {
        if (max_prime_div_of_n[j] == 0 || ((j % i) == 0 && prime[i] == 1)) {
          max_prime_div_of_n[j] = i;
        }
      }
    }
  }
  for (int i = 2; i <= 100; i++)
    if (max_prime_div_of_n[i] == 0) max_prime_div_of_n[i] = i;
}
long long int sum_prime_fac[1000001];
void sieve4() {
  sum_prime_fac[1000001] = {0};
  for (long long int i = 2; i <= 1000000; i++) {
    if (!sum_prime_fac[i]) {
      for (long long int j = i; j <= 1000000; j += i) sum_prime_fac[j] += i;
    }
  }
}
bool is_even(long long int n) { return (!(n & 2)); }
bool is_odd(long long int n) { return (n & 2); }
long long int sum(long long int n) {
  long long int sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool isPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n == 5) return true;
  if ((n % 2 == 0) || (n % 3 == 0) || (n % 5 == 0)) return false;
  for (long long int i = 5; i * i <= n; i += 6)
    if ((n % i == 0) || (n % (i + 2) == 0)) return false;
  return true;
}
long long int reversenum(long long int x) {
  long long int num = 0;
  while (x > 0) {
    num = num * 10 + x % 10;
    x = x / 10;
  }
  return num;
}
bool ispalindrome(string s) {
  string q = s;
  reverse(q.begin(), q.end());
  return (s == q);
}
bool isvowel(char x) {
  return (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u');
}
long long int sumarr(long long int a[], long long int n) {
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) sum += a[i];
  return sum;
}
long long modmul(long long a, long long b) {
  return ((a % 998244353) * (b % 998244353)) % 998244353;
}
long long modadd(long long a, long long b) {
  return ((a % 998244353) + (b % 998244353) + 998244353) % 998244353;
}
long long modsub(long long a, long long b) {
  return ((a % 998244353) - (b % 998244353) + 998244353) % 998244353;
}
long long int fastexpo(long long int a, long long int b) {
  a = a % 998244353;
  long long int ans = 1;
  while (b) {
    if (b % 2) ans = (ans * 1ll * a) % 998244353;
    a = (a * 1ll * a) % 998244353;
    b = b / 2;
  }
  return ans;
}
long long int findmax(long long int a[], long long int x, long long int y) {
  long long int maxi = -1;
  for (long long int i = x; i <= y; i++) maxi = max(maxi, a[i]);
  return maxi;
}
long long int phi[7000005];
void euler_phi() {
  for (long long int i = 0; i < 7000005 - 1; i++) phi[i + 1] = i + 1;
  for (long long int p = 2; p < 7000005; p++) {
    if (phi[p] == p) {
      phi[p] = p - 1;
      for (long long int i = 2 * p; i < 7000005; i += p)
        phi[i] = (phi[i] / p) * (p - 1);
    }
  }
}
long long int myphi(long long int n) {
  long long int result = n;
  for (long long int p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      while (n % p == 0) n /= p;
      result -= result / p;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
void prime_factorise(long long int n, map<long long int, long long int> &mp) {
  while (n % 2 == 0) {
    mp[2]++;
    n /= 2;
  }
  for (long long int i = 3; i * i <= n; i += 2) {
    while (n % i == 0) {
      mp[i]++;
      n /= i;
    }
  }
  if (n > 1) mp[n]++;
}
long long int largestPower(long long int n, long long int p) {
  long long int total = 0;
  while (n) {
    n /= p;
    total += n;
  }
  return total;
}
long long int facto(long long int n) {
  long long int ans = 1;
  for (long long int i = 1; i <= n; i++) ans = modmul(ans, i);
  return ans;
}
void finddiv(long long int n, set<long long int> &st) {
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      st.insert(i);
      st.insert(n / i);
    }
  }
}
long long int findncr(long long int n, long long int r) {
  if (n < r)
    return 0;
  else {
    r = min(r, n - r);
    long long int a = 1, b = 1;
    for (long long int i = 0; i < r; i++) {
      a = (a * (n - i)) % 998244353;
      b = (b * (i + 1)) % 998244353;
    }
    a = modmul(a, fastexpo(b, 998244353 - 2));
    return a;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    string s;
    cin >> s;
    int f[26] = {0};
    for (long long int i = 0; i < int(s.size()); i++) {
      f[s[i] - 'a']++;
    }
    for (long long int i = 25; i >= 0; i--) {
      if (f[i]) {
        for (long long int j = 0; j < f[i]; j++) {
          cout << char(i + 'a');
        }
        return 0;
      }
    }
  }
  return 0;
}
