poj1218. simulation process