#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long indeg[26], to[26];
  bool needed[26], vis[26];
  for (long long i = 0; i < 26; i++) {
    indeg[i] = 0;
    to[i] = -1;
    needed[i] = vis[i] = false;
  }
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < s.length(); j++) needed[s[j] - 'a'] = true;
    for (long long j = 0; j < s.length() - 1; j++) {
      indeg[s[j + 1] - 'a']++;
      if (to[s[j] - 'a'] == -1)
        to[s[j] - 'a'] = s[j + 1] - 'a';
      else if (to[s[j] - 'a'] != s[j + 1] - 'a') {
        cout << "NO\n";
        exit(0);
      }
    }
  }
  string res;
  for (long long i = 0; i < 26; i++) {
    if (vis[i] || indeg[i] > 0 || !needed[i]) continue;
    for (long long j = i; j != -1; j = to[j]) {
      if (vis[j]) {
        cout << "NO\n";
        exit(0);
      }
      res += (char)('a' + j);
      vis[j] = true;
    }
  }
  for (long long i = 0; i < 26; i++) {
    if (needed[i] && !vis[i]) {
      cout << "NO\n";
      exit(0);
    }
  }
  cout << res << '\n';
}
