Solved water jugs problem with extended Euclid GCD method in Haskell