#include <bits/stdc++.h>
using namespace std;
#define int long long
int n;
string c(string x){
int f = n/2;
string h = "";
for(int i = 0; i < f; i++){
h += x[i];
}
int co = 0;
for(int i = 0; i < n; i++){
if(co == f*2) break;
if(h[co%f] == x[i]){
co++;
}
}
if(co == 2*f){
return h;
}else{
return "-1";
}
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n;
string x; cin >> x;
string r_x = x;
reverse(r_x.begin(), r_x.end());
if(c(x) != "-1" && c(r_x) != "-1"){
string h = c(r_x);
reverse(h.begin(), h.end());
if(h == c(x)){
cout << h << "\n";
return 0;
}
cout << "NOT UNIQUE" << "\n";
}else if(c(x) == "-1" && c(r_x) != "-1"){
string rx = c(r_x);
reverse(rx.begin(), rx.end());
cout << rx << "\n";
}else if(c(x) != "-1" && c(r_x) == "-1"){
cout << c(x) << "\n";
}else{
cout << "NOT POSSIBLE" << "\n";
}
return 0;
}