Python: Greatest Common Divisor of Strings