#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18, MOD = 1e9 + 7, MAXN = 105;
const long double EPS = 1e-9, PI = acos(-1);
int32_t main() {
  int64_t n;
  cin >> n;
  vector<string> str(n);
  for (int64_t i = 0; i < n; ++i) cin >> str[i];
  vector<int64_t> next(26, -1), prev(26, -1);
  vector<bool> used(26);
  for (int64_t i = 0; i < n; ++i) {
    for (int64_t j = 0; j < str[i].size() - 1; ++j) {
      if ((next[str[i][j] - 'a'] != -1 &&
           next[str[i][j] - 'a'] != str[i][j + 1] - 'a') ||
          (prev[str[i][j + 1] - 'a'] != -1 &&
           prev[str[i][j + 1] - 'a'] != str[i][j] - 'a')) {
        cout << "NO" << endl;
        return 0;
      }
      used[str[i][j] - 'a'] = true;
      next[str[i][j] - 'a'] = str[i][j + 1] - 'a';
      prev[str[i][j + 1] - 'a'] = str[i][j] - 'a';
    }
    used[str[i].back() - 'a'] = true;
  }
  string answer = "";
  for (int64_t i = 0; i < 26; ++i) {
    if (used[i] && prev[i] == -1) {
      int64_t now = i;
      while (next[now] != -1) {
        answer += (char)(now + 'a');
        used[now] = false;
        now = next[now];
      }
      answer += (char)(now + 'a');
      used[now] = false;
    }
  }
  for (int64_t i = 0; i < 26; ++i) {
    if (used[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << answer << endl;
  return 0;
}
