#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
char s[3000110];
unsigned long long int power[3000110];
unsigned long long int h[3000110];
unsigned long long int ansh;
int main()
{
int b=233;
power[0]=1;
for(int i=1;i<=3000110;i++)
power[i]=power[i-1]*b;
int m;
scanf("%d",&m);
scanf("%s",s+1);
if(m%2==0)
{
cout<<"NOT POSSIBLE"<<endl;
return 0;
}
int ans=0;
for(int i=1;i<=m;i++)
h[i]=h[i-1]*b+(unsigned long long int)(s[i]-'A'+1);
for(int i=1;i<=m;i++)
{
if(i<=(m+1)/2)
{
unsigned long long int h2=h[m]-h[(m+1)/2]*power[m-(m+1)/2];
unsigned long long int h1=h[(m+1)/2]-h[i]*power[(m+1)/2-i]+h[i-1]*power[(m+1)/2-i];
if(h1==h2)
{
if(ans==0)
{
ansh=h1;
ans=i;
}
else
{
if(ansh!=h1)
{
cout<<"NOT UNIQUE"<<endl;
return 0;
}
}
}
}
else
{
unsigned long long int h1=h[m/2];
unsigned long long int h2=h[m]-h[i]*power[m-i]+(h[i-1]-h[m/2]*power[i-1-m/2])*power[m-i];
if(h1==h2)
{
if(ans==0)
{
ansh=h1;
ans=i;
}
else
{
if(ansh!=h1)
{
cout<<"NOT UNIQUE"<<endl;
return 0;
}
}
}
}
}
if(ans==0)
{
cout<<"NOT POSSIBLE"<<endl;
return 0;
}
int i=1;
int to=1;
while(to<=m/2)
{
if(i!=ans)
{
to++;cout<<s[i];
}
i++;
}
return 0;
}