#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 1000;
const int ml = 26;
int n;
string s[maxn];
int nxt[ml], pre[ml], cont[ml];
bool init() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> s[i];
  for (int i = 0; i < ml; ++i) nxt[i] = pre[i] = -1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < ml; ++j) cont[j] = 0;
    for (int j = 1; j < s[i].size(); ++j) {
      int a = int(s[i][j - 1] - 'a');
      int b = int(s[i][j] - 'a');
      if (cont[a]) return false;
      if (nxt[a] != -1 and nxt[a] != b) return false;
      if (pre[b] != -1 and pre[b] != a) return false;
      nxt[a] = b;
      pre[b] = a;
      cont[a]++;
    }
    if (cont[s[i][s[i].size() - 1] - 'a']) return false;
  }
  for (int i = 0; i < ml; ++i) {
    int u = nxt[i];
    while (u != -1 and u != i) u = nxt[u];
    if (u == i) return false;
  }
  for (int i = 0; i < ml; ++i) cont[i] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < s[i].size(); ++j) {
      cont[s[i][j] - 'a']++;
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  if (init()) {
    for (int i = 0; i < ml; ++i) {
      if (pre[i] == -1 and cont[i]) {
        int u = i;
        while (u != -1) {
          cout << char(u + 'a');
          u = nxt[u];
        }
      }
    }
    cout << '\n';
  } else
    cout << "NO\n";
}
