#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y3N0cmluZz4KI2luY2x1ZGUgPGZzdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpjb25zdCBpbnQgTUFYX0xJTkVTID0gMjA7CmNvbnN0IGludCBNQVhfTEVOR1RIID0gMTAwMDsKCmJvb2wgaXNWYWxpZENoYXJhY3RlcihjaGFyIGMpIHsKICAgIHJldHVybiAoYyA+PSAnYScgJiYgYyA8PSAneicpIHx8IChjID49ICdBJyAmJiBjIDw9ICdaJykgfHwgKGMgPT0gJyonKTsKfQoKdm9pZCBmb3JtYXRUZXh0KGNoYXIgdGV4dFtdW01BWF9MRU5HVEggKyAxXSwgaW50IGxpbmVDb3VudCwgaW50IG1heExlbmd0aCkgewogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBsaW5lQ291bnQ7ICsraSkgewogICAgICAgIGludCBsZW5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