#include <cstdio>
#include <cstring>
using namespace std;
char s[3011];
int main()
{
    int n, cnt = 0;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%s", s + i);
    int f = 0, b = strlen(s) - 1;
    while (f <= b)
    {
        bool flag = false;
        for (int i = 0; f + i <= b; ++i)
        {
            if (s[f + i] < s[b - i])
            {
                flag = true;
                break;
            }
            if (s[f + i] > s[b - i])
            {
                flag = false;
                break;
            }
        }
        putchar(s[flag ? f++ : b--]);
        if ((++cnt) % 80 == 0) putchar('\n');
    }
    return 0;
}