#include "testlib.h"
#include <vector>
#include <string>
#include <algorithm> // reverse 需要
#include <map>
using namespace std;

int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);
    
    int n = inf.readInt();     // 读选手输出的 k
    string s = ouf.readString();    // 读字符串

    // 1. 长度检查
    if ((int)s.size() != n) {
        quitf(_wa, "Length wrong.");
    }


    // 3. 字符串必须是回文
    string t = s;
    reverse(t.begin(), t.end());
    if (t != s) {
        quitf(_wa, "string wrong.");
    }

    // 4. 每个字符出现次数 ≤ 2
    map<char, int> cnt;
    for (char c : s) {
        cnt[c]++;
        if (cnt[c] > 2) {
            quitf(_wa, "duplicate");
        }
    }

    // 全部通过
    quitf(_ok, "All checks passed.");
}
