from easyinput import read

n = read(int)
while n is not None:
  print(largest_prime_factor(n))  
  n = read(int)

