import sequtils,strutils,algorithm var N, K : int (N, K) = stdin.readline.split.map(parseInt) var n = 1 yaku = newSeq[int](0) while n * n <= N: if N mod n == 0: yaku.add(n) if n != (N div n): yaku.add(N div n) n += 1 yaku.sort(system.cmp) yaku.reverse() for n in yaku: if N div n >= 2: echo n break