#include<iostream>
#include<cstdio>
#include<vector>
#include<map>
#include<string>
#include<iomanip>
#include<utility>
#include<algorithm>
#include<cmath>
#include<deque>
#include<set>
#include<queue>
using namespace std;
typedef long long int ll;
#define sz(x) ((long long ll)(x).size())
#define pb push_back
#define pii pair<ll, ll>
#define itn ll
#define mp make_pair
#define y1 yyyyyyyy1
ll gcd (ll a, ll b) {
	return b ? gcd (b, a % b) : a;
}
int cycle;
vector <set <int> > g(28), ing(28);
vector <int> used(28, 0), inused(28, 0), cnt(28, 0), cnt2(28, 0);

void dfs(int v) {
    used[v] = 1;
    if (g[v].size() > 1)
        cycle = 1;
    for (int u : g[v]) {
        if (used[u] == 1)
            cycle = 1;
        if (!used[u])
            dfs(u);
    }
    used[v] = 2;
}

void idfs(int v) {
    inused[v] = 1;
    if (ing[v].size() > 1)
        cycle = 1;
    for (int u : ing[v]) {
        if (inused[u] == 1)
            cycle = 1;
        if (!inused[u])
            idfs(u);
    }
    inused[v] = 2;
}

void print(int v) {
    used[v] = 1;
    char a = v + 'a';
    cout << a;
    for (int u : g[v])
        if (!used[u])
            print(u);
}

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        string s;
        cin >> s;
        int m = sz(s);
        for (int j = 1; j < m; ++j) {
            int u = s[j] - 'a';
            int v = s[j - 1] - 'a';
            ing[u].insert(v);
        }
        for (char a : s)
            cnt[a - 'a']++;
        for (int j = 0; j < m - 1; ++j) {
            int u = s[j] - 'a';
            int v = s[j + 1] - 'a';
            g[u].insert(v);
           // cnt2[v]++;
        }
    }
    for (int i = 0; i < 26; ++i)
        if (!used[i])
            dfs(i);
    for (int i = 0; i < 26; ++i)
        if (!inused[i])
            idfs(i);
    if (cycle) {
        cout << "NO" << endl;
        return 0;
    }
    used.resize(0);
    used.resize(30, 0);
    for (int i = 0; i < 26; ++i)
        if (!used[i] && cnt2[i] == 0 && cnt[i] != 0)
            print(i);
    cout << endl;
    return 0;
}
