#include <bits/stdc++.h>
using namespace std;
string ans = "NOT POSSIBLE";
bool check(string &s, int pos, int n)
{
string ns;
for (int i = 0; i < n; i++) {
if (i != pos) ns += s[i];
}
bool c = true;
for (int i = 0; i < n / 2; i++) {
if (ns[i] != ns[i + n / 2]) c = false;
}
if (c) {
string t;
for (int i = 0; i < n / 2; i++) {
t += ns[i];
}
ans = t;
}
return c;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
string s;
cin >> s;
if (!(n & 1)) {
cout << "NOT POSSIBLE";
return 0;
}
int sl = n / 2;
int ct = 0;
for (int i = 0; i < n; i++) {
if (check(s, i, n)) ct++;
}
if (ct >= 2) cout << "NOT UNIQUE";
else cout << ans;
return 0;
}