#include <iostream>
#include <cstring>
using namespace std;

const int MAX_SIZE = 2000;

bool isLetter(char c) {
	return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}

void changeLetter(char text[], const int firstPos, const int numOfWords, const int numOfLetters) {
    if (numOfWords <= numOfLetters) {
        text[firstPos + numOfWords - 1] = 'a';
    } else {
        text[firstPos] = 'a'; 
    }
}

void modifyText(char text[], int &numOfWords) {
    int firstPos = 0, numOfLetters = 0, textLength = strlen(text);
    bool prevLetter = false;
    for (int i = 0; i <= textLength; ++i) {
        if (isLetter(text[i])) {
            ++numOfLetters;
            if (prevLetter == false) {
            	++numOfWords;
                firstPos = i;
            }
            prevLetter = true;
        } else if (prevLetter) {
            changeLetter(text, firstPos, numOfWords, numOfLetters);
            numOfLetters = 0;
            prevLetter = false;
        }
    }
}

int main() {
    char text[MAX_SIZE + 1];
    int numOfWords = 0;
    while (cin.getline(text, MAX_SIZE + 1)) {
        modifyText(text, numOfWords);
        cout << text << '\n';
    }
    return 0;
}