import log

main() {
	log.number(gcd(1071, 462))
}

gcd(a Int, b Int) -> Int {
	loop {
		switch {
			a == b { return a }
			a > b  { a -= b }
			_      { b -= a }
		}
	}
}