#include #include using namespace std; using ll = long long; constexpr ll BASE = 26; int main() { string s; cin >> s; int n = s.length(); ll hash[n][11]; for(int i=0;i> m; string c; for(int i=0;i> c; int nc = c.length(); ll c_hash = ll(c[0]-'A'); for(int j=1;j