#include using std::cin; using std::cout; using std::min; using std::string; using std::vector; using P = std::pair; int main() { string s; cin >> s; int n = s.size(); char t = s[0]; for (int i = 1; i < n; ++i) t = min(t, s[i]); int p = s.find(t); int k = p + 1; while (s[k] == s[p]) ++k; string ans = s.substr(p, k) + "a"; cout << ans << '\n'; return 0; }