ll@N,@S;string a;REP(i,3**N){setT;rep(n,N)T.insert(i/3**n%3);if(T.size()>2&&--S<1){rep(n,N)a.push_back(65+i/3**(N-1-n)%3);wt(a);exit(0);}}wt(-1);