solved sherlock and gcd