euclid's algorithm in java