#include <iostream>
#include <string.h>

using namespace std;

int main ()
{
    char s[100], t[100];
    int i, j;

    cout << "The string is: " << endl;
    cin.get (s, 100);

    strcpy (t, s);
    for (i = 0, j = 0; i < strlen (s); i++, j++) {
        if (s[i] == 'a') {
            strcat (strcpy (s + i, "aa"), t + j);
            i += 2;
        }
    }

    cout << "The modified string is: " << endl;
    cout << s;
}