Problem G
Mean Words
Little Timmy got caught by his teacher using some mean words. After getting sent to the principal, little Timmy learned his lesson - he should do his best to not get caught next time!
What Timmy decided to do is to take all the mean words that he wants to say, and combine them all together into a single "mean" word by getting the average of all the characters in the same position across all the words that have a character in that position, and then rounding this average down to get the character in that position.
Note: The value of a character is its ASCII value, so the value of a is $97$, the value of b is $98$ and so on up to z, which has value $122$. So when we average characters, we are averaging their ASCII values, rounding this down to the nearest integer, and then using the corresponding character as the result of this averaging.
Help Timmy create his mean mean words!
Input
The first line contains a single integer $N$ ($2 \leq N \leq 1\, 000$), which represents the number of words that follow. The next $N$ lines contain a single word between $1$ and $45$ lowercase English characters each.
Output
Output the mean word obtained by following Timmy’s procedure.
Sample Input 1 | Sample Output 1 |
---|---|
2 mean word |
rjii |
Sample Input 2 | Sample Output 2 |
---|---|
4 words of various length |
rfpfrns |
Sample Input 3 | Sample Output 3 |
---|---|
3 a b b |
a |