private int hash(String s) { int ret = 0; for (int i = 0; i < s.Length; i++) ret = ret * 31 + s[i]; return ret; }