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

alphabet.forEach(function(char) {
    map[char] = {
        to: undefined,
        from: 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 prevChar = str[j-1];
            var to = map[curChar].to;
            var from = map[curChar].from;

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

            charMapForStr[curChar] = true;
            if (j != str.length -1 ) map[curChar].to = nextChar;
            if (j != 0 ) map[curChar].from = prevChar;
        }
    }

if (!hasResult) {
    print ("NO");
} else {
    var isOk = true;
    var result = '';
    var charMapForStr = {};
    for(var i=0; i<alphabet.length; i++) {
        var char = alphabet[i];
        if (!map[char].from) {
            var curChar = char;
            result = result + curChar;
            if (charMapForStr[curChar]) {
                isOk = false;
                break;
            }
            charMapForStr[curChar] = true;
            while(map[curChar].to) {
                curChar = map[curChar].to;
                result = result + curChar;
                if (charMapForStr[curChar]) {
                    isOk = false;
                    break;
                }
                charMapForStr[curChar] = true;
            }
        }
    }
    if (!isOk) {
        print('NO');
    } else {
        print(result);
    }
}