#include #define rep(i, l, r) for (int i = (l); i < (r); i++) using namespace std; typedef long long ll; int main() { string S; cin >> S; int x = 0, y = 0; rep(i, 0, S.size()) { if (S[i] == 'a') { x++; } else { y = max(x, y); x = 0; } } y = max(x, y); rep(i, 0, y + 1) cout << "a"; cout << endl; }