program main
implicit None
	integer::n,m,a,i
	
	read *,n,m
	
	a = m/n
	
	do while (a > 0)
		if (mod(m,a) == 0)then
			exit
		endif
		a = a-1
	enddo
	
	print 102,a
	
	
101 format(a)
102 format(i0)
end program main