#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const unsigned gen_seed =
    std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937_64 gen(gen_seed);
const int MAXN = 100000;
vector<int> lst[MAXN];
int parent[MAXN];
void make_set(int v) {
  lst[v] = vector<int>(1, v);
  parent[v] = v;
}
int find_set(int v) { return parent[v]; }
void union_sets(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (a != b) {
    if (lst[a].size() < lst[b].size()) swap(a, b);
    while (!lst[b].empty()) {
      int v = lst[b].back();
      lst[b].pop_back();
      parent[v] = a;
      lst[a].push_back(v);
    }
  }
}
int main() {
  int n;
  scanf("%d\n", &n);
  std::vector<string> s(n);
  for (int i = 0; i < n; i++) {
    getline(cin, s[i]);
    std::vector<int> cnt(26, 0);
    for (auto x : s[i]) cnt[x - 'a']++;
    for (int j = 0; j < 26; j++)
      if (cnt[j] > 1) {
        printf("NO");
        return 0;
      }
  }
  for (int i = 0; i < n; i++) make_set(i);
  std::vector<std::vector<int> > sym(26);
  for (int i = 0; i < n; i++)
    for (auto x : s[i]) sym[x - 'a'].push_back(i);
  for (int snum = 0; snum < 26; snum++) {
    int k = sym[snum].size();
    for (int i = 0; i < k - 1; i++) {
      int a = find_set(sym[snum][i]);
      int b = find_set(sym[snum][i + 1]);
      if (a != b) {
        int p = s[a].size();
        int q = s[b].size();
        int pos1 = 0, pos2 = 0;
        while (s[a][pos1] != 'a' + snum) pos1++;
        while (s[b][pos2] != 'a' + snum) pos2++;
        int mxp = max(pos1, pos2);
        int len = max(p - pos1, q - pos2) + mxp;
        string news;
        for (int j = 0; j < len; j++) {
          int np1 = j + pos1 - mxp;
          int np2 = j + pos2 - mxp;
          char c1 = '.';
          char c2 = '.';
          if (np1 >= 0 && np1 < p) c1 = s[a][np1];
          if (np2 >= 0 && np2 < q) c2 = s[b][np2];
          if (c1 != '.' && c2 != '.' && c1 != c2) {
            printf("NO");
            return 0;
          } else if (c1 != '.')
            news.push_back(c1);
          else
            news.push_back(c2);
        }
        std::vector<int> cnt(26, 0);
        for (auto x : news) cnt[x - 'a']++;
        for (int j = 0; j < 26; j++)
          if (cnt[j] > 1) {
            printf("NO");
            return 0;
          }
        union_sets(a, b);
        s[find_set(a)] = news;
      }
    }
  }
  std::vector<string> alls;
  for (int i = 0; i < n; i++)
    if (!lst[i].empty()) alls.push_back(s[i]);
  sort((alls).begin(), (alls).end());
  string ans;
  for (auto x : alls) ans = ans + x;
  printf("%s", ans.c_str());
}
