import seqUtils, strutils proc gcd(a, b:int64): int64 = var big = max(a, b) small = min(a, b) while small > 0: (big, small) = (small, big mod small) return big let tmp: seq[int64] = stdin.readLine.split.map parseBiggestInt (a, b) = (tmp[0], tmp[1]) echo gcd(a, b)