commit POJ1240 by TA