#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> next(26, -1), last(26, -1);
  vector<bool> is_used(26, false);
  for (int i = 0; i < n; i++) {
    vector<bool> is_s(26, false);
    string s;
    cin >> s;
    for (char c : s) {
      c -= 'a';
      if (is_s[c]) {
        cout << "NO";
        return 0;
      } else {
        is_s[c] = true;
        is_used[c] = true;
      }
    }
    for (int i = 0; i < s.size() - 1; i++) {
      char c = s[i] - 'a';
      if (next[c] != -1 && next[c] != s[i + 1] - 'a') {
        cout << "NO";
        return 0;
      } else {
        next[c] = s[i + 1] - 'a';
        last[s[i + 1] - 'a'] = c;
      }
    }
  }
  vector<string> ans;
  vector<bool> is_vis(26, false);
  for (int i = 0; i < 26; i++)
    if (is_used[i] && last[i] == -1) {
      ans.push_back("");
      for (int j = i; j != -1; j = next[j]) {
        is_vis[j] = true;
        ans.rbegin()->push_back(j + 'a');
      }
    }
  for (int i = 0; i < 26; i++)
    if (is_used[i] && !is_vis[i]) {
      cout << "NO";
      return 0;
    }
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) cout << ans[i];
}
