fun gcd(a: int): int -> int is
	fun gcd2(b: int): int is
		if a = 0 then
			b
		else if b = 0 then
			a
		else if fun AlessB (i:int):bool is
				if a - i = b then
					false
				else if a + i = b then
					true
				else
					AlessB (i + 1)
				fi fi end 0 then
			gcd a (fun BmodA(b:int):int is
					if fun BlessA(i:int):bool is
							if b - i = a then
								false
							else if b + i = a then
								true
							else
								BlessA (i + 1)
							fi fi end 0 then
						b
					else
						BmodA (b - a)
					fi end b)
		else
			gcd (fun AmodB(a:int):int is
					if fun AlessB(i:int):bool is
							if a - i = b then
								false
							else if a + i = b then
								true
							else
								AlessB (i + 1)
							fi fi end 0 then
						a
					else
						AmodB (a - b)
					fi end a) b
		fi fi fi end end
386 96;
