Adding solution to problem 439, except it will take forever.