public static int GCD(int input1, int input2) {
		if(input1==0||input2==0) {return 0;}
		if(input1<0||input2<0) {return -1;}

		int remainder;
		while((remainder=input1%input2)!=0) {
			input1 = input2;
			input2 = remainder;
		} 

		return input2;
	}