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

const int MAX_LINES = 20;
const int MAX_LENGTH = 1000;

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

void formatText(char text[][MAX_LENGTH + 1], int lineCount, int maxLength) {
    for (int i = 0; i < lineCount; ++i) {
        int lengthCurrentLine = strlen(text[i]);
        if (lengthCurrentLine == 0 || text[i][lengthCurrentLine - 1] == '*') {
            continue;
        }
        int numAsterisks = maxLength - lengthCurrentLine;
        char formattedLine[MAX_LENGTH + 1];
        for (int j = 0; j < numAsterisks; ++j) {
            formattedLine[j] = '*';
        }
        strcpy(formattedLine + numAsterisks, text[i]);
        formattedLine[maxLength] = '\0'; 

        cout << formattedLine << "\n"; 
    }
}

int main() {
    ifstream fin("input.txt");
    char text[MAX_LINES][MAX_LENGTH + 1];
    int lineCount = 0;
    int maxLength = 0;
    while (cin.getline(text[lineCount], MAX_LENGTH + 1)) {
        int length = strlen(text[lineCount]);
        if (length > maxLength) {
            maxLength = length; 
        }
        ++lineCount;
    }
    formatText(text, lineCount, maxLength);
    return 0;
}
