#include int main() { int N,K; scanf ("%d %d",&N,&K); while (K > 0){ if (N % K == 0){ printf ("%d\n",K); break; } K--; } return 0; }