gcd (haskell)
gcd with writer