#include <iostream>
using namespace std;


int largest_prime_factor(int n);


int main() {
  int n;
  while (cin >> n) cout << largest_prime_factor(n) << endl;
  return 0;
}
