Move gcd to toString