#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;
}

int main() {
    FILE *ff = fopen("igra.in", "r");
    FILE *gg = fopen("igra.out", "w");
    char pom[5555][55];
    string res;
    string s, spom;
    int dokle, n;
    fscanf(ff, "%d", &n);
    char c[5555][55];
    for (int i = 1; i <= n; i++) {
        fscanf(ff, "%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;
        }
    }

    fprintf(gg, "1\n");
    for (int i = 0; i < res.size(); i++) fprintf(gg, "%c", res[i]);

}
