public class StringForHashing {
    String s;
    public StringForHashing(String s) {
        this.s = s;
    }
    public int hashCode() {
        int sum=0, term=0, mod4=0;
        for (int j=0; j<s.length(); ++j) {
            term |= s.charAt(j);
            mod4 = (mod4 + 1) % 4;
            if (mod4 == 0) {
                sum ^= term;
                term = 0;
            }
            else term <<= 8;
        }
        if (mod4 != 0) sum ^= term;
        return sum;
    }
    public String get() { return s; }
}
