''' Python3(PyPy3) Template for Programming-Contest. author : sgsw generated : 2021/08/13 when : 21:45:24 ''' import sys def input(): return sys.stdin.readline().rstrip() DXY = [(0, -1), (1, 0), (0, 1), (-1, 0)] # LDRU mod = 998244353 inf = 1 << 64 def main(): s = list(input()) s = list(map(lambda x: ord(x),s)) m = min(s) b = s.count(m) c = chr(m) print(c * (b + 1)) return 0 if __name__ == "__main__": main()