#include #include #include #include #include using namespace std; set st; void solve(string t){ if(st.count(t)) return; st.insert(t); int i,j,k,n = t.size(); for(i=0;i> n >> s; int a = 0,ab = 0,abc = 0,b = 0,bc = 0,bca = 0,c = 0,ca = 0,cab = 0; vector cnt(3); for(i=0;i