POJ-1001, AC but with a very ugly way