#include #include #include using namespace std; const int n=3; using Hash=array; const Hash mod={1000000097,1000000087,1000000093}; const Hash B={1198,19285,51616}; Hash Base[1<<20]; Hash operator+(Hash lhs,const Hash&rhs) { for(int i=0;i>N; setV; for(;N--;) { string S;cin>>S; Hash now{}; for(int i=0;i