#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <string>
#include <cstring>
using namespace std;
string niz[250555];
int br = 0, pobeda[250555];
char pomm[5555][55];

int uporedi (string s1, string s2) {
    if (s1.size() != s2.size()) if (s1.size() < s2.size()) return 1;
                                else return 2;
    int n = s1.size();
    for (int i = 0; i < n; i++) if (s1[i] != s2[i]) if (s1[i] < s2[i]) return 1;
                                                    else return 2;
    return 0;
}

bool cmp (string s1, string s2) {
    //return s1 < s2;
    if (s1.size() != s2.size()) return (s1.size() < s2.size());
    int n = s1.size();
    for (int i = 0; i < n; i++) if (s1[i] != s2[i]) return (s1[i] < s2[i]);
    return 0;
}

int hesh (string s1) {
    int levo = 1, desno = br;
    int pom = (levo+desno)/2;
    int brojac = 0;
    while (uporedi(niz[pom], s1) != 0) {
        //printf("%d ", pom);
        pom = (levo+desno)/2;
        if (uporedi(niz[pom+1], s1) == 0) return pom+1;
        if (uporedi(niz[pom], s1) == 2) desno = pom;
        else levo = pom;
        //brojac++;
        //if (brojac == 10) while (1){}
    }
    return pom;
}
int main() {
    char pom[5555][55];
    string res;
    string s, spom;
    int dokle, n;
    scanf("%d", &n);
    char c[5555][55];
    for (int i = 1; i <= n; i++) {
        scanf("%s", &c[i]);
        s.assign(c[i]);
        if (i == 1) res = s;
        else {
            if ((uporedi(res, s) == 2) && (s.size() % 2 == 0)) res = s;
        }
        dokle = s.size();
        for (int j = 0; j < dokle; j++) {
            pom[i][j] = c[i][j];
            s.assign(pom[i]);
            br++;
            niz[br] = s;
        }
    }
    sort(niz+1, niz+br+1, cmp);

    printf("1\n");
    for (int i = 0; i < res.size(); i++) printf("%c", res[i]);
    /*
    for (int i = 1; i <= br; i++) {
        for (int j = 0; j < niz[i].size(); j++) printf("%c", niz[i][j]);
        printf("\n");
    }

    printf("%d\n\n\n", br);
    for (int i = 1; i <= br; i++) printf("%d ", hesh(niz[i])); */



    /*int mark[5555], t;
    for (int i = 0; i < 5555; i++) mark[i] = 0;
    for (int i = 1; i <= n; i++) {
        int tacno = 1;

        int k = strlen(c[i]);
        pobeda = k % 2;
        if (pobeda == 0) pobeda += 2;
        for (int j = k-1; j >= 0; j--) {
            for (int z = 1; z <= n; z++) if (z != i) {
                t = 1;
                for (int zz = 0; zz <= j; zz++) if */

}
