poj solution