#include <bits/stdc++.h>
using namespace std;
int N;
bool has[30];
bool ghas[30];
int pos[30];
int ri[30], lf[30];
string str;
bool first;
bool vis[30];
bool con(int a, int b) {
  if (ri[a] && lf[b]) {
    return (ri[a] == b);
  } else if (!ri[a] && !lf[b]) {
    ri[a] = b;
    lf[b] = a;
    return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> str;
    memset(has, 0, sizeof(has));
    for (char c : str) {
      int ai = c - 'a' + 1;
      if (has[ai]) {
        first = true;
        break;
      }
      has[ai] = true;
      ghas[ai] = true;
    }
    if (first) break;
    int S = str.size();
    if (S == 1) continue;
    int nx, ai;
    for (int i = 0; i <= S - 2; i++) {
      ai = str[i] - 'a' + 1;
      nx = str[i + 1] - 'a' + 1;
      if (!con(ai, nx)) {
        first = true;
        break;
      }
    }
    if (first) break;
    if (ri[nx]) {
      if (!con(nx, ri[nx])) {
        first = true;
        break;
      }
    }
  }
  if (first) {
    cout << "NO" << '\n';
    return 0;
  }
  vector<int> ans;
  for (int i = 1; i <= 26; i++) {
    if (vis[i] || !ghas[i] || lf[i]) continue;
    int now = i;
    while (now && !vis[now]) {
      ans.push_back(now);
      now = ri[now];
    }
  }
  for (int ai : ans) cout << (char)('a' + ai - 1);
  cout << '\n';
  return 0;
}
