PE001 solved in C, Java, Haskell and Python