#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <vector>
#define pb push_back

using namespace std;

vector<string>wordz;
char tabl[101][11];
string sol;

int main(){
    int n; cin >>n;
    string str;
    int big=0;
    for(int i=0; i<n; i++){
        cin >> str; if(str.size()>big) big=str.size();
        wordz.pb(str);
    }
    for(int i=0; i<n; i++){
        for(int j=0; j<wordz[i].size(); j++){
            if(sol.find(wordz[i][j])==-1) sol.pb(wordz[i][j]);
            tabl[i][j+1]=wordz[i][j];
        }
    }
    for(int i=0; i<n; i++) tabl[i][0]='-';
    char temp, loc1, loc2;
    for(int i=big-1; i>0; i--){
        for(int j=0; j<n-1; j++){
            if(tabl[j][i]>='a' and tabl[j][i]<='z' and tabl[j][i-1]==tabl[j+1][i-1]){
                loc1=sol.find(tabl[j][i]);
                loc2=sol.find(tabl[j+1][i]);
                if(loc1>loc2){
                    temp=sol[loc1];
                    sol[loc1]=sol[loc2];
                    sol[loc2]=temp;
                }
            }
        }
    }
    int check = 0;
    for(int i=big-1; i>0; i--){
        for(int j=0; j<n-1; j++){
            if(tabl[j][i]>='a' and tabl[j][i]<='z' and tabl[j][i-1]==tabl[j+1][i-1]){
                loc1=sol.find(tabl[j][i]);
                loc2=sol.find(tabl[j+1][i]);
                if(loc1>loc2){ sol = "!"; check = 1; break; }
            }
        }
        if(check) break;
    }


    cout << sol << endl;

    return 0;
}

/*
    for(int i=0; i<n; i++){
        for(int j=0; j<big; j++)
            cout << tabl[i][j] << " ";
        cout << endl;
    }
*/
