var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var arr=input.trim().split("\n");
var n=arr.shift()-0;
var s=arr.shift().split("");
var [a,b]=[0,0];
s.forEach(v=>{
   if("ABCDEFGHIJKLM".includes(v))a+=1
   else if("NOPQRSTUVWXYZ".includes(v))a-=1
   else if("abcdefghijklm".includes(v))b+=1
   else if("nopqrstuvwxyz".includes(v))b-=1
});
str="";
if(a>0)str+="A".repeat(a);
else if(a<0)str+="N".repeat(a*-1);
if(b>0)str+="a".repeat(b);
else if(b<0)str+="n".repeat(b*-1);
console.log(str.length);
console.log(str);

