sherlock and gcd