#include<bits/stdc++.h>
using namespace std;
#define ll int 
#define pb push_back
#define mod 1000000007
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<pair<ll,ll>, null_type,less<pair<ll,ll>>, rb_tree_tag,tree_order_statistics_node_update> 
#define Find find_by_order
#define Pos order_of_key
#define N 1000000
#define F(i,n) for(int i=1;i<=n;i++)
#define f(i,n) for(int i=0;i<n;i++)
int main()
{
    ios_base::sync_with_stdio();
    cin.tie(0);
    cout.tie(0);

    ll n;
    cin>>n;
    
    ll vis[26];
    f(i,26) vis[i]=0;
    set<ll> v[26];
    f(j,n)
    {
        string s;
        cin>>s;
        vis[s[0]-'a']+=-1;
        for(int i=1;i<s.size();i++)
        {
            v[s[i-1]-'a'].insert(s[i]-'a');
            vis[s[i]-'a']+=2*n;
        }
    }
    set<string> s1;
    f(i,26)
    {
        if(vis[i]<0)
        {
            ll p=i;
            char c='a'+p;
            string t="";
            t+=c;
            while(v[p].size()!=0)
            {
                if(v[p].size()!=1)
                {
                    cout<<"NO\n";
                    return 0;
                }
                p=(*(v[p].begin()));
                char c='a'+p;
                t+=c;
            }
            s1.insert(t);
        }
    }
    if(s1.size()==0) 
    {
        cout<<"NO\n";
        return 0;
    }
    for(auto it:s1)
    {
        cout<<it;
    }
}