#include <bits/stdc++.h>
using namespace std;
const int N = 3000000;
const int MOD = 1e9 + 7;
const int C = 26;
int n;
int cnext[C], cprev[C];
int degIn[C], degOut[C];
int status[C];
bool used[C];
bool flag;
string ans;
void dfs(int v) {
  status[v] = 1;
  if (cnext[v] != -1) {
    if (status[cnext[v]] == 1) flag = false;
    if (status[cnext[v]] == 2) dfs(cnext[v]);
  }
  status[v] = 2;
}
void addEdge(int u, int v) {
  if (u == v) {
    flag = false;
    return;
  }
  if (cnext[u] != -1 && cnext[u] != v) {
    flag = false;
    return;
  }
  if (cprev[v] != -1 && cprev[v] != u) {
    flag = false;
    return;
  }
  degIn[v]++;
  cnext[u] = v;
  cprev[v] = u;
}
int main() {
  cin >> n;
  memset(cnext, -1, sizeof(cnext));
  memset(cprev, -1, sizeof(cprev));
  memset(used, false, sizeof(used));
  flag = true;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int m = s.length();
    for (int j = 0; j < m; j++) {
      used[s[j] - 'a'] = true;
    }
    for (int j = 0; j < m - 1; j++) {
      addEdge(s[j] - 'a', s[j + 1] - 'a');
    }
  }
  for (int i = 0; i < C; i++) {
    if (!status[i]) {
      dfs(i);
    }
  }
  if (flag) {
    ans = "";
    memset(status, 0, sizeof(status));
    for (int i = 0; i < C; i++) {
      if (!status[i] && used[i] && degIn[i] == 0) {
        int j = i;
        while (j != -1) {
          status[j] = 1;
          ans += j + 'a';
          j = cnext[j];
        }
      }
    }
    cout << ans;
  } else {
    cout << "NO";
  }
  return 0;
}
