added gcd.py, TernaryTree.java