#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <stack>
#include <set>
#include <cassert>
#include <ctime>
#include <unordered_set>
#include <complex>
#include <queue>

#define vd vector<double>
#define pb push_back
#define all(v) v.begin(), v.end()
#define x first
#define y second
#define mp make_pair
#define forn(i, l) for (int i = 0; i < l; i++)

using namespace std;
typedef pair<int, int> pi;
typedef long long li;
const int N = 1e5 + 10;
const double eps = 0.00000000001, eps2 = 0.0001;
const int INF = (int)1e9 + 2;
const long long LINF = 1e16;
const double PI = acos(-1.0);
int n;
char buff[N];
string s[N];
int ref[2][30];
bool used[30], used1[30];
string ans;
bool ok = 1;

void dfs(int cur) {
	used1[cur] = 1;
	int to = ref[0][cur];
	ans += char(cur + 'a');
	if (to == -1) {
		return ;
	}
	if (used1[to]) {
		ok = 0;
		return;
	}
	dfs(to);
}

int main() {
#ifdef _DEBUG
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	scanf("%d", &n);
	forn(i, n) {
		scanf("%s", buff);
		s[i] = string(buff);
	}
	memset(ref, -1, sizeof ref);
	forn(i, n) {
		used[s[i][0] - 'a'] = 1;
		forn(j, s[i].length() - 1) {
			int to = s[i][j + 1] - 'a';

			int from = s[i][j] - 'a';
			used[to] = 1;
			if ((ref[1][to] > 0) && (ref[1][to] != from) || (ref[0][from] > 0) && (ref[0][from] = !to)) {
				ok = 0;
				break;
			}
			ref[0][from] = to;
			ref[1][to] = from;
		}
	}
	forn(i, 26) {
		if (used[i] && !used1[i]) {
			dfs(i);
		}
	}
	ans = "";
	forn(i, 26) {
		if (ref[1][i] == -1 && used[i]) {
			dfs(i);
		}
	}
	if (ok)
		printf("%s", ans.c_str());
	else {
		printf("NO");
	}
	return 0;
}