#include <cstdio> #include <cstring> #include <cctype> #include <vector> #include <queue> #include <iostream> using namespace std; const int NN=128; const int INF=0x3fffffff; int n,cnt1,cnt2,hash[NN],tmpf[NN],cur[NN],num[NN],tag[NN],w[NN][NN]; char id[NN]; bool single[NN]; vector<int> fav[NN]; int get() { int x; char ch=getchar(); while (!isalpha(ch)) ch=getchar(); if (islower(ch)) { x=ch-'a'; if (!hash[x]) { hash[x]=++cnt1; id[cnt1]=ch; } } else { x=ch-'A'+26; if (!hash[x]) { hash[x]=++cnt2; id[cnt2]=ch; } } return hash[x]; } void init() { scanf("%d",&n); cnt1=0; cnt2=n; memset(hash,0,sizeof(hash)); for (int i=1; i<=n*2; i++) /