#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
int N;
string s;
bool can(string a,int deb){
int p=0;
bool skip=false;
for(int i=deb;i<deb+(N+1)/2&&p<a.size();i++){
if(a[p]==s[i]){
p++;
}
else{
if(skip)
return false;
skip=true;
}
}
return true;
}
void solve(){
cin >> N;
cin >> s;
vector<int> occ(26,0);
for(int i=0;i<N;i++){
occ[s[i]-'A']++;
}
int cntodd=0;
for(int i=0;i<26;i++){
cntodd += occ[i]%2;
}
if(cntodd!=1){
cout << "NOT POSSIBLE" << endl;
return;
}
string a="",b="";
for(int i=0;i<N/2;i++){
a+=s[i];
}
for(int i=N/2+1;i<N;i++){
b+=s[i];
}
if(a==b){
cout << a << endl;
return;
}
if(can(a,N/2)&&can(b,0)){
cout << "NOT UNIQUE" << endl;
}
else{
if(can(a,N/2)){
cout << a << endl;
}
else if(can(b,0)){
cout << b << endl;
}
else{
cout << "NOT POSSIBLE" << endl;
}
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int t=1;
//cin >> t;
while(t--){
solve();
}
}