#include <bits/stdc++.h>
using namespace std;
int n;
char s[101101];
bool chk;
bool occ[33];
int ideg[33], odeg[33];
char ans[33], la;
void add_edge(char ch1, char ch2) {
  ch1 -= 'a';
  ch2 -= 'a';
  if (odeg[ch1] == -1)
    odeg[ch1] = ch2;
  else if (odeg[ch1] != ch2)
    chk = false;
  if (ideg[ch2] == -1)
    ideg[ch2] = ch1;
  else if (ideg[ch2] != ch1)
    chk = false;
}
void dfs(int cur) {
  occ[cur] = false;
  ans[la++] = cur + 'a';
  if (odeg[cur] != -1) dfs(odeg[cur]);
}
int main() {
  scanf("%d", &n);
  chk = true;
  memset(occ, false, sizeof occ);
  memset(ideg, -1, sizeof ideg);
  memset(odeg, -1, sizeof odeg);
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    int len = strlen(s);
    for (int j = 0; j < len; j++) occ[s[j] - 'a'] = true;
    for (int j = 1; j < len; j++) add_edge(s[j - 1], s[j]);
    sort(s, s + len);
    for (int j = 1; j < len; j++)
      if (s[j] == s[j - 1]) chk = false;
  }
  if (chk) {
    la = 0;
    for (int i = 0; i < 26; i++)
      if (occ[i] && ideg[i] < 0) dfs(i);
    for (int i = 0; i < 26; i++)
      if (occ[i]) chk = false;
  }
  if (chk) {
    for (int i = 0; i < la; i++) putchar(ans[i]);
    puts("");
  } else {
    puts("NO");
  }
  return 0;
}
