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



for i in range(M // N, 0, -1):

  if M % i == 0:

    print(i)

    exit()
def main():

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



  for i in range(M // N, 0, -1):

    if M % i == 0:

      print(i)

      break

      

if __name__ == '__main__':

  main()
N, M = list(map(int, input().split()))
for i in range(M // N, 0, -1):
    if M % i == 0:
        print(i)
        exit()

def main():
    N, M = list(map(int, input().split()))
    for i in range(M // N, 0, -1):
        if M % i == 0:
            print(i)
            break


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) -for i in range(M // N, 0, -1): -    if M % i == 0: -        print(i) -        exit() +def main(): +    N, M = list(map(int, input().split())) +    for i in range(M // N, 0, -1): +        if M % i == 0: +            print(i) +            break + + +if __name__ == "__main__": +    main()