#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 100105;
const double PI = acos(-1.0);
const double eps = 1e-6;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
int n;
char st[N];
char s[30][30], ans[100005];
int cnt[27], l[30], len, in[27], out[27], v[128];
bool pp[27], bz[27];
void swap(char s[], char t[]) {
  int l1 = strlen(s), l2 = strlen(t), l = ((l1) > (l2) ? (l1) : (l2));
  for (int i = (0); i <= (l - 1); ++i) swap(s[i], t[i]);
}
bool I(char st[], int len) {
  int k = st[0] - 'a', t = ((len) < (l[k]) ? (len) : (l[k]));
  if (len > l[k]) l[k] = len, swap(st, s[k]);
  for (int i = (0); i <= (t - 1); ++i)
    if (st[i] != s[k][i]) return 0;
  return 1;
}
bool check(char st[], int len) {
  if (len > 26) return 0;
  memset(cnt, 0, sizeof(cnt));
  for (int i = (0); i <= (len - 1); ++i) {
    cnt[st[i] - 'a']++;
    if (cnt[st[i] - 'a'] > 1) return 0;
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    scanf("%s", st);
    len = strlen(st);
    if (!I(st, len)) return 0 * printf("NO\n");
  }
  memset(out, -1, sizeof(out));
  memset(in, -1, sizeof(in));
  for (int i = (0); i <= (25); ++i) {
    if (!l[i]) continue;
    if (l[i] == 1) {
      pp[i] = 1;
      continue;
    }
    for (int j = (0); j <= (l[i] - 2); ++j) {
      if (out[s[i][j] - 'a'] == -1 || out[s[i][j] - 'a'] == s[i][j + 1] - 'a')
        out[s[i][j] - 'a'] = s[i][j + 1] - 'a';
      else
        return 0 * printf("NO\n");
      if (in[s[i][j + 1] - 'a'] == -1 || in[s[i][j + 1] - 'a'] == s[i][j] - 'a')
        in[s[i][j + 1] - 'a'] = s[i][j] - 'a';
      else
        return 0 * printf("NO\n");
    }
  }
  memset(v, 0, sizeof(v));
  memset(bz, 0, sizeof(bz));
  for (int i = (0); i <= (25); ++i)
    if (out[i] != -1) bz[out[i]] = 1;
  for (int i = (0); i <= (25); ++i) {
    if (v[i]) continue;
    if (in[i] == -1 && out[i] != -1) {
      int y = i;
      while (1) {
        if (v[y]) return 0 * printf("NO\n");
        v[y] = 1;
        ans[++ans[0]] = y;
        y = out[y];
        if (y == -1) break;
      }
    } else if (!bz[i] && pp[i])
      ans[++ans[0]] = i, v[i] = 1;
  }
  for (int i = (1); i <= (n); ++i)
    if (!v[i] && out[i] != -1) return 0 * printf("NO\n");
  for (int i = (1); i <= (ans[0]); ++i) printf("%c", ans[i] + 'a');
  printf("\n");
  return 0;
}
