#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod = 1e9 + 7;
ll n,m,k;
void solve(){
cin >> n;
string str;
cin >> str;
if(n % 2 == 0){
cout << "NOT POSSIBLE\n";
return;
}
set<string>st;
string ans;
for(int i = 0;i<str.size();i++){
string a = "", b = "";
int j = 0;
while(a.size() < n / 2){
if(j == i){
j += 1;
continue;
}
a += str[j++];
}
while(b.size() < n / 2){
if(j == i){
j += 1;
continue;
}
b += str[j++];
}
if(a == b){
st.insert(a);
ans = a;
}
}
int cnt = st.size();
if(cnt == 0){
cout << "NOT POSSIBLE\n";
return;
}
if(cnt > 1){
cout << "NOT UNIQUE\n";
return;
}
cout << ans << "\n";
}
/*
7
ABXCABC
*/
signed main()
{
// freopen("seq.in", "r", stdin);
// freopen("seq.out", "w", stdout);
ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
int tt=1;//cin >> tt;
while(tt--)solve();
}