#include #include #include #include using namespace std; map mp; string s; int n,L; int main() { cin.sync_with_stdio(false); cin >> n; while(n--) { cin>>s; L = s.size(); sort(s.begin(),s.end()); cout << mp[s] <