import java.io.*; public class Hash { static { System.loadLibrary("rdtsc"); } native long rdtsc(); int test(String line) { int h = 0; System.out.print("length " + line.length() + ": "); for (int n = 0; n < 10; n++) { long s = rdtsc(); h = line.hashCode(); long f = rdtsc(); System.out.print(f - s); System.out.print(' '); } System.out.println(); return h; } public static void main(String[] args) { Hash hash = new Hash(); try { BufferedReader reader = new BufferedReader( new InputStreamReader(System.in)); while (true) { String line = reader.readLine(); if (line == null) break; hash.test(line); } } catch (Throwable t) { t.printStackTrace(); } } }