#include <bits/stdc++.h>using namespace std ;int main() { int n; while(cin>>n){ for(int i=2; i<=sqrt(n); i+=(i==2?1:2)) if(n%i==0) {n/=i; break;} cout<<n<<endl; }}