Solved Sherlock and GCD .py & .java