n,m=list(map(int,input().split()))

for i in range(n,10**8):

  if m%i==0:

    print((m//i))

    exit()

print((1))





n,m=list(map(int,input().split()))



yakusuu=[]

import math

for i in range(1,int(math.sqrt(m)+1)):

  if m%i==0:

    yakusuu.append(i)

    yakusuu.append(m//i)

yakusuu.sort()

for num in yakusuu:

  if num>=n:

    print((m//num))

    exit()

    

    
n, m = list(map(int, input().split()))
for i in range(n, 10**8):
    if m % i == 0:
        print((m // i))
        exit()
print((1))

n, m = list(map(int, input().split()))
yakusuu = []
import math

for i in range(1, int(math.sqrt(m) + 1)):
    if m % i == 0:
        yakusuu.append(i)
        yakusuu.append(m // i)
yakusuu.sort()
for num in yakusuu:
    if num >= n:
        print((m // num))
        exit()

-for i in range(n, 10**8): +yakusuu = [] +import math + +for i in range(1, int(math.sqrt(m) + 1)): -        print((m // i)) +        yakusuu.append(i) +        yakusuu.append(m // i) +yakusuu.sort() +for num in yakusuu: +    if num >= n: +        print((m // num)) -print((1))