#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N = 26;
vector<int> g[N];
int color[N], pr[N], degin[N], u[N], have[N];
string cur;
vector<string> ans;
bool dfs1(int v) {
  color[v] = true;
  for (auto& x : g[v])
    if (color[x] == 0) {
      pr[x] = v;
      if (dfs1(x)) return true;
    } else if (color[x] == 1) {
      cout << "NO\n";
      exit(0);
    }
  color[v] = 2;
  return false;
}
void dfs2(int v) {
  u[v] = true;
  cur += char(v + 'a');
  for (auto& x : g[v])
    if (!u[x]) dfs2(x);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n = 0;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    have[s[0] - 'a']++;
    for (int j = 1; j < s.size(); j++) {
      have[s[j] - 'a']++;
      g[s[j - 1] - 'a'].push_back(s[j] - 'a');
      degin[s[j] - 'a']++;
    }
  }
  for (int i = 0; i < 26; i++)
    if (color[i] == 0 && dfs1(i)) break;
  for (int i = 0; i < 26; i++)
    if (degin[i] == 0 && (!g[i].empty() || have[i])) {
      cur.clear();
      dfs2(i);
      ans.push_back(cur);
    }
  sort((ans).begin(), (ans).end());
  for (auto& x : ans) cout << x;
  return 0;
}
