#include <bits/stdc++.h>
#define F first
#define S second
#define ll long long
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
// 9th grade
string s;
int n;
cin>>n>>s;
map<char, int> mp;
for(int i = 0; i < s.size(); i++) {
mp[s[i]]++;
}
set<char> st;
st.insert(s.begin(), s.end());
char c;
int cnt = 0;
for(char i : st) {
if(mp[i]%2!=0) {
c=i;
cnt++;
}
}
if(cnt!=1) {
cout<<"NOT POSSIBLE\n";
return 0;
}
if(st.size()==1) {
for(int i = 0; i < s.size()/2; i++) {
cout<<s[i];
}
return 0;
}
int g = 0;
bool ok=0;
for(int i = 0; i < s.size(); i++) {
if(s[i]==c&&!ok) {ok=1;g=i;break;}
}
if(g==0&&s[s.size()-1]==c) {
cout<<"NOT UNIQUE\n";
} else {
string s1, s2;
for(int i = 0; i < s.size(); i++) {
if(i<s.size()/2)
s1+=s[i];
else
s2+=s[i];
}
int i = 0, j = 0;
while(true) {
if(s1[i]==s2[j]) {
i++, j++;
} else if(s1[i]!=s2[j]) {
j++;
}
if(i>=s1.size()||j>=s2.size()) break;
}
if(i==s1.size()) {
cout<<s1<<'\n';
return 0;
}
s1="", s2="";
for(int i = 0; i < s.size(); i++) {
if(i<s.size()/2+1)
s1+=s[i];
else
s2+=s[i];
}
i = 0, j = 0;
while(true) {
if(s2[i]==s1[j]) {
i++, j++;
} else if(s2[i]!=s1[j]) {
j++;
}
if(i>=s2.size()||j>=s1.size()) break;
}
if(i==s2.size()) {
cout<<s2<<'\n';
return 0;
}
cout<<"NOT POSSIBLE\n";
}
// end of code
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgRiBmaXJzdAojZGVmaW5lIFMgc2Vjb25kCiNkZWZpbmUgbGwgbG9uZyBsb25nCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnNpZ25lZCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7CiAgICBjb3V0LnRpZSgwKTsKICAgIC8vIDl0aCBncmFkZQogICAgc3RyaW5nIHM7CiAgICBpbnQgbjsKICAgIGNpbj4+bj4+czsKICAgIG1hcDxjaGFyLCBpbnQ+IG1wOwogICAgZm9yKGludCBpID0gMDsgaSA8IHMuc2l6ZSgpOyBpKyspIHsKICAgICAgICBtcFtzW2ldXSsrOwogICAgfQogICAgc2V0PGNoYXI+IHN0OwogICAgc3QuaW5zZXJ0KHMuYmVnaW4oKSwgcy5lbmQoKSk7CiAgICBjaGFyIGM7CiAgICBpbnQgY250ID0gMDsKICAgIGZvcihjaGFyIGkgOiBzdCkgewogICAgICAgIGlmKG1wW2ldJTIhPTApIHsKICAgICAgICAgICAgYz1pOwogICAgICAgICAgICBjbnQrKzsKICAgICAgICB9CiAgICB9CiAgICBpZihjbnQhPTEpIHsKICAgICAgICBjb3V0PDwiTk9UIFBPU1NJQkxFXG4iOwogICAgICAgIHJldHVybiAwOwogICAgfQogICAgaWYoc3Quc2l6ZSgpPT0xKSB7CiAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IHMuc2l6ZSgpLzI7IGkrKykgewogICAgICAgICAgICBjb3V0PDxzW2ldOwogICAgICAgIH0KICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIGludCBnID0gMDsKICAgIGJvb2wgb2s9MDsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzLnNpemUoKTsgaSsrKSB7CiAgICAgICAgaWYoc1tpXT09YyYmIW9rKSB7b2s9MTtnPWk7YnJlYWs7fQogICAgfQogICAgaWYoZz09MCYmc1tzLnNpemUoKS0xXT09YykgewogICAgICAgIGNvdXQ8PCJOT1QgVU5JUVVFXG4iOwogICAgfSBlbHNlIHsKICAgICAgICBzdHJpbmcgczEsIHMyOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgIGlmKGk8cy5zaXplKCkvMikKICAgICAgICAgICAgczErPXNbaV07CiAgICAgICAgICAgIGVsc2UgCiAgICAgICAgICAgIHMyKz1zW2ldOwogICAgICAgIH0KICAgICAgICBpbnQgaSA9IDAsIGogPSAwOwogICAgICAgIHdoaWxlKHRydWUpIHsKICAgICAgICAgICAgaWYoczFbaV09PXMyW2pdKSB7CiAgICAgICAgICAgICAgICBpKyssIGorKzsKICAgICAgICAgICAgfSBlbHNlIGlmKHMxW2ldIT1zMltqXSkgewogICAgICAgICAgICAgICAgaisrOwogICAgICAgICAgICB9CiAgICAgICAgICAgIGlmKGk+PXMxLnNpemUoKXx8aj49czIuc2l6ZSgpKSBicmVhazsKICAgICAgICB9CiAgICAgICAgaWYoaT09czEuc2l6ZSgpKSB7CiAgICAgICAgICAgIGNvdXQ8PHMxPDwnXG4nOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICAgICAgczE9IiIsIHMyPSIiOwogICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBzLnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgIGlmKGk8cy5zaXplKCkvMisxKQogICAgICAgICAgICBzMSs9c1tpXTsKICAgICAgICAgICAgZWxzZSAKICAgICAgICAgICAgczIrPXNbaV07CiAgICAgICAgfQogICAgICAgIGkgPSAwLCBqID0gMDsKICAgICAgICB3aGlsZSh0cnVlKSB7CiAgICAgICAgICAgIGlmKHMyW2ldPT1zMVtqXSkgewogICAgICAgICAgICAgICAgaSsrLCBqKys7CiAgICAgICAgICAgIH0gZWxzZSBpZihzMltpXSE9czFbal0pIHsKICAgICAgICAgICAgICAgIGorKzsKICAgICAgICAgICAgfQogICAgICAgICAgICBpZihpPj1zMi5zaXplKCl8fGo+PXMxLnNpemUoKSkgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGlmKGk9PXMyLnNpemUoKSkgewogICAgICAgICAgICBjb3V0PDxzMjw8J1xuJzsKICAgICAgICAgICAgcmV0dXJuIDA7CiAgICAgICAgfQogICAgICAgIGNvdXQ8PCJOT1QgUE9TU0lCTEVcbiI7CiAgICB9CiAgICAvLyBlbmQgb2YgY29kZQp9