//#pragma GCC target("avx,avx2,fma")
//#pragma GCC optimize("unroll-loops,Ofast")
#include <bits/stdc++.h>

/*{{{*/
using namespace std;
#ifdef LOCAL
#include<pprint.hpp> // https://github.com/p-ranav/pprint
pprint::PrettyPrinter P(cerr);
#define de(...) P.compact(true);P.print('[', #__VA_ARGS__,"] =", __VA_ARGS__)
#define de_nc(...) P.compact(false);P.print('[', #__VA_ARGS__,"] =", __VA_ARGS__)
#else
#define de(...)
#define de_nc(...)
#endif
#define all(x) (x).begin(),(x).end()
using ll = long long;
using pii = pair<int, int>;

inline namespace Traits {
    // is iterable
    template<typename T, typename = void> struct is_iterable : false_type {};
    template<typename T>
    struct is_iterable<T, void_t<decltype(begin(declval<T>())), decltype(end(declval<T>()))>> : true_type {};
    template<typename T> constexpr bool is_iterable_v = is_iterable<T>::value;
    // is readable
    template<typename T, typename = void> struct is_readable : false_type {};
    template<typename T>
    struct is_readable<T, enable_if_t<is_same_v<decltype(cin >> declval<T&>()), istream&>>> : true_type {};
    template<typename T> constexpr bool is_readable_v = is_readable<T>::value;
    // is printable
    template<typename T, typename = void> struct is_printable : false_type {};
    template<typename T>
    struct is_printable<T, enable_if_t<is_same_v<decltype(cout << declval<T>()), ostream&>>> : true_type {};
    template<typename T> constexpr bool is_printable_v = is_printable<T>::value;
}
inline namespace Input {
    template<typename T> constexpr bool needs_input_v = !is_readable_v<T> && is_iterable_v<T>;
    template<typename T, typename U> void re(pair<T, U>& p);
    template<typename T> enable_if_t<is_readable_v<T>> re(T& x) { cin>>x; }
    template<typename T> enable_if_t<needs_input_v<T>> re(T& v) { for (auto& x : v) re(x); }
    template<typename... T> void re(T&... args) {(re(args), ...);}
    template<typename T, typename U> void re(pair<T, U>& p) { re(p.first, p.second); };
}
inline namespace Output {
    template<typename T> constexpr bool needs_output_v = !is_printable_v<T> && is_iterable_v<T>;
    template<int offset=0, typename... T> void wr(T... args);
    template<int offset=0,typename T> enable_if_t<is_printable_v<T> && is_integral_v<T>> _W(const T& x) { cout<<x+offset; }
    template<int offset=0,typename T> enable_if_t<is_printable_v<T> && !is_integral_v<T>> _W(const T& x) { cout<<x; }
    template<int offset=0,typename T, typename U> void _W(const pair<T, U>& p) { wr<offset>(p.first, p.second); }
    template<int offset=0,typename It> void _W(It f, const It& l) { for (;f!=l; ++f) { _W<offset>(*f); if (f!=l) cout<<' '; }}
    template<int offset=0,typename T> enable_if_t<needs_output_v<T>> _W(const T& x) { _W<offset>(begin(x), end(x)); }
    template<int offset, typename... T> void wr(T... args) { 
        int i=0; ((_W<offset>(args), ++i, cout<<(i==sizeof...(args) ? '\n' : ' ')), ...);
#ifdef LOCAL
        cout.flush();
#endif
    }
}
template<typename T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; } // set a = min(a,b)
template<typename T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }/*}}}*/

void solve() {
    int n;
    re(n);
    vector<string> a(n);
    re(a);
    vector g(26, vector(26, 0));
    vector<int> ind(26);
    vector<bool> appear(26);
    for (auto& s : a) {
        for (auto& ch : s) appear[ch-'a']=true;
        for (int i=1; i<(int)s.size(); i++) {
            g[s[i-1]-'a'][s[i]-'a']=1;
            ind[s[i]-'a']++;
        }
    }
    de_nc(g);
    vector<int> vis(26);
    string ans;
    auto dfs=[&](auto& dfs, int u) -> void {
        vis[u]=true;
        ans+=char(u+'a');
        if (count(all(g[u]), 1)>1) {
            wr("NO");
            exit(0);
        }
        for (int i=0; i<26; i++) {
            if (g[u][i] ) {
                if (vis[i]) {
                    wr("NO");
                    exit(0);
                } else {
                    dfs(dfs, i);
                }
            }
        }
    };
    for (int i=0; i<26; i++) {
        if (ind[i]==0 && appear[i]==1) {
            dfs(dfs, i);
        }
    }
    if (ans.empty()) wr("NO");
    else wr(ans);
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int tt=1;
    while (tt--) {
        solve();
    }
    return 0;
}
