var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
var map = {};

alphabet.forEach(function(char) {
	map[char] = {
		isFirstChar: false,
		used: false,
		direction: undefined
	};
});

var n = Number(readline());
var hasResult = true;

cycle:
for(var i = 0; i<n; i++) {
	var str = readline();

	var charMapForStr = {};
	for (var j = 0; j < str.length; j++) {
		var curChar = str[j];
		var nextChar = str[j+1];
		var direction = map[curChar].direction;

		if (charMapForStr[curChar] || direction && nextChar && direction != nextChar) {
			hasResult = false;
			break cycle;
		}

		charMapForStr[curChar] = true;
		if (map[curChar].isFirstChar) {
			map[curChar].isFirstChar = j===0;
		} else {
			map[curChar].isFirstChar = j===0 && !map[curChar].used;
		}
		map[curChar].used = true;
		if (j != str.length -1 ) map[curChar].direction = nextChar;
	}
}

if (!hasResult) {
	print ("NO");
} else {
	var result = '';
	alphabet.forEach(function(char) {
		if (map[char].isFirstChar) {
			var curChar = char;
			result = result + curChar;
			while(map[curChar].direction) {
				curChar = map[curChar].direction;
				result = result + curChar;
			}
		}
	});
	var isOk = true;
	var charMapForStr = {};
	for (var j = 0; j < result.length; j++) {
	    if (charMapForStr[result[j]]) {
	        isOk = false;
	        break;
	    }
	    charMapForStr[result[j]] = true;
	}
	if (!result || !isOk) {
	    print('NO');
	}
	print(result);
}