poj2419. hash. well, not exactly.