//code of JUYU ^ ^ never doubt youself ! #include #define For(i,a,b) for(int i=a;i<=b;i++) #define Rep(i,b,a) for(int i=a;i>=b;--i) #define ms(a,b) memset(a,b,sizeof a) #define fir first #define sec second #define eb emplace_back #define pb push_back #define mk make_pair using namespace std; typedef long long ll; typedef pair PII; const int MOD = 1e9 + 7; const int N = 1e5 + 10; int ans; //exactly you can get the answer int main() { string s; cin >> s; int len = s.size(); For(i,0,len-1) if (s[i] == 'a') ans ++; cout << 'a'; For(i,1,ans) cout << 'a'; cout << endl; return 0; } /* stuff you should look for * int overflow, array bounds * special cases (n=1?) * do smth instead of nothing and stay organized * WRITE STUFF DOWN * DON'T GET STUCK ON ONE APPROACH -- Benq */