for POJ problems