N, M = list(map(int, input().split()))



if N == 1:

    print(M)

else:

    d = max(d for d in range(1, M // N + 1) if M % d == 0)

    print(d)

import math



N, M = list(map(int, input().split()))



def divisors(M):

    for d in range(1, math.floor(math.sqrt(M)) + 1):

        if M % d == 0:

            yield d

            yield M // d



d = max(d for d in divisors(M) if d <= M // N)

print(d)
N, M = list(map(int, input().split()))
if N == 1:
    print(M)
else:
    d = max(d for d in range(1, M // N + 1) if M % d == 0)
    print(d)

import math

N, M = list(map(int, input().split()))


def divisors(M):
    for d in range(1, math.floor(math.sqrt(M)) + 1):
        if M % d == 0:
            yield d
            yield M // d


d = max(d for d in divisors(M) if d <= M // N)
print(d)

+import math + -if N == 1: -    print(M) -else: -    d = max(d for d in range(1, M // N + 1) if M % d == 0) -    print(d) + + +def divisors(M): +    for d in range(1, math.floor(math.sqrt(M)) + 1): +        if M % d == 0: +            yield d +            yield M // d + + +d = max(d for d in divisors(M) if d <= M // N) +print(d)