#include std::string S; bool used[1000]; int L; int count(char c){ int res = 0; for(int i=0;i> T; while(T--){ std::cin >> S; L = S.size(); for(int i=0;i